You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2012/01/23 22:18:13 UTC

svn commit: r1234990 [2/2] - in /commons/proper/functor/trunk: ./ src/main/java/org/apache/commons/functor/adapter/ src/main/java/org/apache/commons/functor/core/algorithm/ src/main/java/org/apache/commons/functor/core/collection/ src/main/java/org/apa...

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BaseUnaryPredicateList.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Abstract base class for {@link UnaryPredicate UnaryPredicates}
@@ -114,10 +115,7 @@ abstract class BaseUnaryPredicateList<A>
      * @param p UnaryPredicate to add
      */
     protected void addUnaryPredicate(UnaryPredicate<? super A> p) {
-        if (p == null) {
-            throw new IllegalArgumentException("Cannot add null UnaryPredicate");
-        }
-        list.add(p);
+        list.add(Validate.notNull(p, "Cannot add null UnaryPredicate"));
     }
 
     // protected

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryCompositeBinaryFunction.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryFunction BinaryFunction} composed of
@@ -113,10 +114,11 @@ public class BinaryCompositeBinaryFuncti
      */
     public <G, H> BinaryCompositeBinaryFunction(BinaryFunction<? super G, ? super H, ? extends T> f,
             BinaryFunction<? super L, ? super R, ? extends G> g, BinaryFunction<? super L, ? super R, ? extends H> h) {
-        if (f == null || g == null || h == null) {
-            throw new IllegalArgumentException("BinaryFunction arguments may not be null");
-        }
-        this.helper = new Helper<G, H, L, R, T>(f, g, h);
+        this.helper = new Helper<G, H, L, R, T>(
+                Validate.notNull(f, "final BinaryFunction argument must not be null"),
+                Validate.notNull(g, "left preceding BinaryFunction argument must not be null"),
+                Validate.notNull(h, "right preceding BinaryFunction argument must not be null")
+        );
     }
 
     // function interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/BinaryNot.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * {@link #test Tests} to the logical inverse
@@ -55,10 +56,7 @@ public final class BinaryNot<L, R> imple
      * @param predicate BinaryPredicate to negate
      */
     public BinaryNot(BinaryPredicate<? super L, ? super R> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "BinaryPredicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryFunction UnaryFunction}
@@ -148,10 +149,7 @@ public class CompositeUnaryFunction<A, T
      * @param function UnaryFunction to call
      */
     public CompositeUnaryFunction(UnaryFunction<? super A, ? extends T> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("function must not be null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "function must not be null");
     }
 
     /**
@@ -180,9 +178,7 @@ public class CompositeUnaryFunction<A, T
      * @return CompositeUnaryFunction<P, T>
      */
     public final <P> CompositeUnaryFunction<P, T> of(UnaryFunction<? super P, ? extends A> preceding) {
-        if (preceding == null) {
-            throw new IllegalArgumentException("preceding function was null");
-        }
+        Validate.notNull(preceding, "preceding function was null");
         return new CompositeUnaryFunction<P, T>(function, preceding);
     }
 

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.adapter.UnaryPredicateUnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryPredicate UnaryPredicate}
@@ -65,10 +66,10 @@ public final class CompositeUnaryPredica
      * @param predicate UnaryPredicate against which the composite functions' output will be tested
      */
     public CompositeUnaryPredicate(UnaryPredicate<? super A> predicate) {
-        if (null == predicate) {
-            throw new IllegalArgumentException("predicate must not be null");
-        }
-        this.function = new CompositeUnaryFunction<A, Boolean>(new UnaryPredicateUnaryFunction<A>(predicate));
+        this.function =
+            new CompositeUnaryFunction<A, Boolean>(
+                new UnaryPredicateUnaryFunction<A>(Validate.notNull(predicate,
+                    "predicate must not be null")));
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/CompositeUnaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryProcedure;
 import org.apache.commons.functor.adapter.UnaryProcedureUnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryProcedure UnaryProcedure}
@@ -65,10 +66,10 @@ public final class CompositeUnaryProcedu
      * @param procedure final UnaryProcedure to run
      */
     public CompositeUnaryProcedure(UnaryProcedure<? super A> procedure) {
-        if (null == procedure) {
-            throw new IllegalArgumentException("procedure must not be null");
-        }
-        this.function = new CompositeUnaryFunction<A, Object>(new UnaryProcedureUnaryFunction<A, Object>(procedure));
+        this.function =
+            new CompositeUnaryFunction<A, Object>(
+                new UnaryProcedureUnaryFunction<A, Object>(Validate.notNull(
+                    procedure, "procedure must not be null")));
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryFunction BinaryFunction}
@@ -78,15 +79,9 @@ public final class ConditionalBinaryFunc
     public ConditionalBinaryFunction(BinaryPredicate<? super L, ? super R> ifPred,
             BinaryFunction<? super L, ? super R, ? extends T> thenFunc,
             BinaryFunction<? super L, ? super R, ? extends T> elseFunc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        if (thenFunc == null || elseFunc == null) {
-            throw new IllegalArgumentException("One or more BinaryFunction arguments was null");
-        }
-        this.ifPred = ifPred;
-        this.thenFunc = thenFunc;
-        this.elseFunc = elseFunc;
+        this.ifPred = Validate.notNull(ifPred, "BinaryPredicate argument was null");
+        this.thenFunc = Validate.notNull(thenFunc, "'then' BinaryFunction argument was null");
+        this.elseFunc = Validate.notNull(elseFunc, "'else' BinaryFunction argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate}
@@ -75,12 +76,9 @@ public final class ConditionalBinaryPred
      */
     public ConditionalBinaryPredicate(BinaryPredicate<? super L, ? super R> ifPred,
             BinaryPredicate<? super L, ? super R> thenPred, BinaryPredicate<? super L, ? super R> elsePred) {
-        if (ifPred == null || thenPred == null || elsePred == null) {
-            throw new IllegalArgumentException("One or more BinaryPredicate arguments was null");
-        }
-        this.ifPred = ifPred;
-        this.thenPred = thenPred;
-        this.elsePred = elsePred;
+        this.ifPred = Validate.notNull(ifPred, "'if' BinaryPredicate argument was null");
+        this.thenPred = Validate.notNull(thenPred, "'then' BinaryPredicate argument was null");
+        this.elsePred = Validate.notNull(elsePred, "'else' BinaryPredicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalBinaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.BinaryProcedure;
 import org.apache.commons.functor.core.NoOp;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryProcedure BinaryProcedure}
@@ -88,15 +89,9 @@ public final class ConditionalBinaryProc
      */
     public ConditionalBinaryProcedure(BinaryPredicate<? super L, ? super R> ifPred,
             BinaryProcedure<? super L, ? super R> thenProc, BinaryProcedure<? super L, ? super R> elseProc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument was null");
-        }
-        this.ifPred = ifPred;
-        if (thenProc == null || elseProc == null) {
-            throw new IllegalArgumentException("One or more BinaryProcedure arguments was null");
-        }
-        this.thenProc = thenProc;
-        this.elseProc = elseProc;
+        this.ifPred = Validate.notNull(ifPred, "BinaryPredicate argument was null");
+        this.thenProc = Validate.notNull(thenProc, "'then' BinaryProcedure argument was null");
+        this.elseProc = Validate.notNull(elseProc, "'else' BinaryProcedure argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.Function;
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link Function Function}
@@ -74,15 +75,9 @@ public final class ConditionalFunction<T
      * @param elseFunc else
      */
     public ConditionalFunction(Predicate ifPred, Function<? extends T> thenFunc, Function<? extends T> elseFunc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("Predicate argument was null");
-        }
-        this.ifPred = ifPred;
-        if (thenFunc == null || elseFunc == null) {
-            throw new IllegalArgumentException("One or more Function arguments was null");
-        }
-        this.thenFunc = thenFunc;
-        this.elseFunc = elseFunc;
+        this.ifPred = Validate.notNull(ifPred, "Predicate argument was null");
+        this.thenFunc = Validate.notNull(thenFunc, "'then' Function argument was null");
+        this.elseFunc = Validate.notNull(elseFunc, "'else' Function argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalPredicate.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link Predicate Predicate}
@@ -72,12 +73,9 @@ public final class ConditionalPredicate 
      * @param elsePred else
      */
     public ConditionalPredicate(Predicate ifPred, Predicate thenPred, Predicate elsePred) {
-        if (ifPred == null || thenPred == null || elsePred == null) {
-            throw new IllegalArgumentException("One or more Predicate arguments was null");
-        }
-        this.ifPred = ifPred;
-        this.thenPred = thenPred;
-        this.elsePred = elsePred;
+        this.ifPred = Validate.notNull(ifPred, "'if' Predicate argument was null");
+        this.thenPred = Validate.notNull(thenPred, "'then' Predicate argument was null");
+        this.elsePred = Validate.notNull(elsePred, "'else' Predicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalProcedure.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.functor.Predicate;
 import org.apache.commons.functor.Procedure;
 import org.apache.commons.functor.core.NoOp;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link Procedure Procedure}
@@ -83,15 +84,9 @@ public final class ConditionalProcedure 
      * @param elseProc else
      */
     public ConditionalProcedure(Predicate ifPred, Procedure thenProc, Procedure elseProc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("Predicate argument was null");
-        }
-        this.ifPred = ifPred;
-        if (thenProc == null || elseProc == null) {
-            throw new IllegalArgumentException("Procedure argument was null");
-        }
-        this.thenProc = thenProc;
-        this.elseProc = elseProc;
+        this.ifPred = Validate.notNull(ifPred, "Predicate argument was null");
+        this.thenProc = Validate.notNull(thenProc, "'then' Procedure argument was null");
+        this.elseProc = Validate.notNull(elseProc, "'else' Procedure argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryFunction UnaryFunction}
@@ -75,16 +76,10 @@ public final class ConditionalUnaryFunct
      * @param elseFunc else
      */
     public ConditionalUnaryFunction(UnaryPredicate<? super A> ifPred, UnaryFunction<? super A, ? extends T> thenFunc,
-            UnaryFunction<? super A, ? extends T> elseFunc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.ifPred = ifPred;
-        if (thenFunc == null || elseFunc == null) {
-            throw new IllegalArgumentException("One or more UnaryFunction arguments was null");
-        }
-        this.thenFunc = thenFunc;
-        this.elseFunc = elseFunc;
+        UnaryFunction<? super A, ? extends T> elseFunc) {
+        this.ifPred = Validate.notNull(ifPred, "UnaryPredicate argument was null");
+        this.thenFunc = Validate.notNull(thenFunc, "'then' UnaryFunction argument was null");
+        this.elseFunc = Validate.notNull(elseFunc, "'else' UnaryFunction argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryPredicate UnaryPredicate}
@@ -74,12 +75,9 @@ public final class ConditionalUnaryPredi
      */
     public ConditionalUnaryPredicate(UnaryPredicate<? super A> ifPred, UnaryPredicate<? super A> thenPred,
             UnaryPredicate<? super A> elsePred) {
-        if (ifPred == null || thenPred == null || elsePred == null) {
-            throw new IllegalArgumentException("One or more UnaryPredicate arguments was null");
-        }
-        this.ifPred = ifPred;
-        this.thenPred = thenPred;
-        this.elsePred = elsePred;
+        this.ifPred = Validate.notNull(ifPred, "'if' UnaryPredicate argument was null");
+        this.thenPred = Validate.notNull(thenPred, "'then' UnaryPredicate argument was null");
+        this.elsePred = Validate.notNull(elsePred, "'else' UnaryPredicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/ConditionalUnaryProcedure.java Mon Jan 23 21:18:10 2012
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
 import org.apache.commons.functor.core.NoOp;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link UnaryProcedure UnaryProcedure}
@@ -85,15 +86,9 @@ public final class ConditionalUnaryProce
     public ConditionalUnaryProcedure(UnaryPredicate<? super A> ifPred,
             UnaryProcedure<? super A> thenProc,
             UnaryProcedure<? super A> elseProc) {
-        if (ifPred == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.ifPred = ifPred;
-        if (thenProc == null || elseProc == null) {
-            throw new IllegalArgumentException("One or more UnaryProcedure arguments was null");
-        }
-        this.thenProc = thenProc;
-        this.elseProc = elseProc;
+        this.ifPred = Validate.notNull(ifPred, "UnaryPredicate argument was null");
+        this.thenProc = Validate.notNull(thenProc, "'then' UnaryProcedure argument was null");
+        this.elseProc = Validate.notNull(elseProc, "'else' UnaryProcedure argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/Not.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.Predicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * {@link #test Tests} to the logical inverse
@@ -54,10 +55,7 @@ public final class Not implements Predic
      * @param predicate Predicate to negate
      */
     public Not(Predicate predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("Predicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "Predicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedFunction.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Transposes (swaps) the arguments to some other
@@ -62,10 +63,7 @@ public class TransposedFunction<L, R, T>
      * @param function BinaryFunction to transpose.
      */
     public TransposedFunction(BinaryFunction<? super R, ? super L, ? extends T> function) {
-        if (function == null) {
-            throw new IllegalArgumentException("BinaryFunction argument was null");
-        }
-        this.function = function;
+        this.function = Validate.notNull(function, "BinaryFunction argument was null");
     }
 
     // functor interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedPredicate.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Transposes (swaps) the arguments to some other
@@ -60,10 +61,7 @@ public class TransposedPredicate<L, R> i
      * @param predicate the BinaryPredicate to transpose
      */
     public TransposedPredicate(BinaryPredicate<? super R, ? super L> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("BinaryPredicate argument must not be null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "BinaryPredicate argument must not be null");
     }
 
     // functor interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransposedProcedure.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Transposes (swaps) the arguments to some other
@@ -60,10 +61,7 @@ public class TransposedProcedure<L, R> i
      * @param procedure BinaryProcedure to transpose
      */
     public TransposedProcedure(BinaryProcedure<? super R, ? super L> procedure) {
-        if (procedure == null) {
-            throw new IllegalArgumentException("BinaryProcedure argument was null");
-        }
-        this.procedure = procedure;
+        this.procedure = Validate.notNull(procedure, "BinaryProcedure argument was null");
     }
 
     // functor interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryFunction.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryFunction;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryFunction BinaryFunction} composed of
@@ -117,13 +118,11 @@ public class UnaryCompositeBinaryFunctio
      */
     public <G, H> UnaryCompositeBinaryFunction(BinaryFunction<? super G, ? super H, ? extends T> f,
             UnaryFunction<? super L, ? extends G> g, UnaryFunction<? super R, ? extends H> h) {
-        if (f == null) {
-            throw new IllegalArgumentException("BinaryFunction must not be null");
-        }
-        if (g == null || h == null) {
-            throw new IllegalArgumentException("Left and right UnaryFunctions may not be null");
-        }
-        this.helper = new Helper<G, H, L, R, T>(f, g, h);
+        this.helper = new Helper<G, H, L, R, T>(
+                Validate.notNull(f, "BinaryFunction must not be null"),
+                Validate.notNull(g, "left UnaryFunction must not be null"),
+                Validate.notNull(h, "right UnaryFunction must not be null")
+        );
     }
 
     // function interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryCompositeBinaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -20,6 +20,7 @@ import java.io.Serializable;
 
 import org.apache.commons.functor.BinaryPredicate;
 import org.apache.commons.functor.UnaryFunction;
+import org.apache.commons.lang3.Validate;
 
 /**
  * A {@link BinaryPredicate BinaryPredicate} composed of
@@ -116,13 +117,11 @@ public class UnaryCompositeBinaryPredica
      */
     public <G, H> UnaryCompositeBinaryPredicate(final BinaryPredicate<? super G, ? super H> f,
             final UnaryFunction<? super L, ? extends G> g, final UnaryFunction<? super R, ? extends H> h) {
-        if (f == null) {
-            throw new IllegalArgumentException("BinaryPredicate must not be null");
-        }
-        if (g == null || h == null) {
-            throw new IllegalArgumentException("Left and right UnaryFunctions may not be null");
-        }
-        helper = new Helper<G, H, L, R>(f, g, h);
+        helper = new Helper<G, H, L, R>(
+                Validate.notNull(f, "BinaryPredicate must not be null"),
+                Validate.notNull(g, "left UnaryFunction must not be null"),
+                Validate.notNull(h, "right UnaryFunction must not be null")
+        );
     }
 
     // function interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/UnaryNot.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.core.
 import java.io.Serializable;
 
 import org.apache.commons.functor.UnaryPredicate;
+import org.apache.commons.lang3.Validate;
 
 /**
  * {@link #test Tests} to the logical inverse
@@ -54,10 +55,7 @@ public final class UnaryNot<A> implement
      * @param predicate UnaryPredicate to negate
      */
     public UnaryNot(UnaryPredicate<? super A> predicate) {
-        if (predicate == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.predicate = predicate;
+        this.predicate = Validate.notNull(predicate, "UnaryPredicate argument was null");
     }
 
     // predicate interface

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/FilteredGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/FilteredGenerator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/FilteredGenerator.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/FilteredGenerator.java Mon Jan 23 21:18:10 2012
@@ -19,6 +19,7 @@ package org.apache.commons.functor.gener
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
 import org.apache.commons.functor.core.composite.ConditionalUnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Generator that filters another Generator by only passing through those elements
@@ -40,14 +41,8 @@ public class FilteredGenerator<E> extend
      * @param pred filtering UnaryPredicate
      */
     public FilteredGenerator(Generator<? extends E> wrapped, UnaryPredicate<? super E> pred) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (pred == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.pred = pred;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.pred = Validate.notNull(pred, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateUntil.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateUntil.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateUntil.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateUntil.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.gener
 
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Wrap another {@link Generator} such that {@link #run(UnaryProcedure)} terminates once
@@ -39,14 +40,8 @@ public class GenerateUntil<E> extends Ba
      * @param test {@link UnaryPredicate}
      */
     public GenerateUntil(Generator<? extends E> wrapped, UnaryPredicate<? super E> test) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (test == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.test = test;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.test = Validate.notNull(test, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateWhile.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateWhile.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateWhile.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/GenerateWhile.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.gener
 
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Wrap another {@link Generator} such that {@link #run(UnaryProcedure)} continues
@@ -39,14 +40,8 @@ public class GenerateWhile<E> extends Ba
      * @param test {@link UnaryPredicate}
      */
     public GenerateWhile(Generator<? extends E> wrapped, UnaryPredicate<? super E> test) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (test == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.test = test;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.test = Validate.notNull(test, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java Mon Jan 23 21:18:10 2012
@@ -15,6 +15,7 @@
 package org.apache.commons.functor.generator;
 
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 import java.util.Iterator;
 
@@ -43,10 +44,7 @@ public final class IteratorToGeneratorAd
      * @param iter Iterator to adapt
      */
     public IteratorToGeneratorAdapter(Iterator<? extends E> iter) {
-        if (null == iter) {
-            throw new IllegalArgumentException("Iterator argument was null");
-        }
-        this.iter = iter;
+        this.iter = Validate.notNull(iter, "Iterator argument was null");
     }
 
     // instance methods

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/TransformedGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/TransformedGenerator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/TransformedGenerator.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/TransformedGenerator.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.gener
 
 import org.apache.commons.functor.UnaryFunction;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Generator that transforms the elements of another Generator.
@@ -39,14 +40,8 @@ public class TransformedGenerator<I, E> 
      * @param func UnaryFunction to apply to each element
      */
     public TransformedGenerator(Generator<? extends I> wrapped, UnaryFunction<? super I, ? extends E> func) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (func == null) {
-            throw new IllegalArgumentException("UnaryFunction argument was null");
-        }
-        this.func = func;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.func = Validate.notNull(func, "UnaryFunction argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/UntilGenerate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/UntilGenerate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/UntilGenerate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/UntilGenerate.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.gener
 
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Wrap another {@link Generator} such that {@link #run(UnaryProcedure)} terminates once
@@ -39,14 +40,8 @@ public class UntilGenerate<E> extends Ba
      * @param test {@link UnaryPredicate}
      */
     public UntilGenerate(UnaryPredicate<? super E> test, Generator<? extends E> wrapped) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (test == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.test = test;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.test = Validate.notNull(test, "UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/WhileGenerate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/WhileGenerate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/WhileGenerate.java (original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/generator/WhileGenerate.java Mon Jan 23 21:18:10 2012
@@ -18,6 +18,7 @@ package org.apache.commons.functor.gener
 
 import org.apache.commons.functor.UnaryPredicate;
 import org.apache.commons.functor.UnaryProcedure;
+import org.apache.commons.lang3.Validate;
 
 /**
  * Wrap another {@link Generator} such that {@link #run(UnaryProcedure)} continues
@@ -39,14 +40,8 @@ public class WhileGenerate<E> extends Ba
      * @param wrapped {@link Generator}
      */
     public WhileGenerate(UnaryPredicate<? super E> test, Generator<? extends E> wrapped) {
-        super(wrapped);
-        if (wrapped == null) {
-            throw new IllegalArgumentException("Generator argument was null");
-        }
-        if (test == null) {
-            throw new IllegalArgumentException("UnaryPredicate argument was null");
-        }
-        this.test = test;
+        super(Validate.notNull(wrapped, "Generator argument was null"));
+        this.test = Validate.notNull(test,"UnaryPredicate argument was null");
     }
 
     /**

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java Mon Jan 23 21:18:10 2012
@@ -218,28 +218,20 @@ public class TestFilteredIterator extend
         assertSame(iter,FilteredIterator.filter(iter,null));
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testConstructorProhibitsNull() {
-        try {
-            new FilteredIterator(null,null);
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
-        try {
-            new FilteredIterator(null,Constant.truePredicate());
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
-        try {
-            new FilteredIterator(list.iterator(),null);
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        new FilteredIterator(null,null);
     }
 
+    @Test(expected = NullPointerException.class)
+    public void testConstructorProhibitsNull2() {
+        new FilteredIterator(null,Constant.truePredicate());
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testConstructorProhibitsNull3() {
+        new FilteredIterator(list.iterator(),null);
+    }
 
     // Attributes
     // ------------------------------------------------------------------------

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsElementOf.java Mon Jan 23 21:18:10 2012
@@ -103,14 +103,9 @@ public class TestIsElementOf extends Bas
         }
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testTestNull() {
-        try {
-            IsElementOf.instance().test(new Integer(5),null);
-            fail("expected IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // expected
-        }
+        IsElementOf.instance().test(new Integer(5),null);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestIsEmpty.java Mon Jan 23 21:18:10 2012
@@ -68,14 +68,9 @@ public class TestIsEmpty extends BaseFun
         }
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testTestNull() throws Exception {
-        try {
-            IsEmpty.instance().test(null);
-            fail("Expected IllegalArgumentException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        IsEmpty.instance().test(null);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestSize.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestSize.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestSize.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestSize.java Mon Jan 23 21:18:10 2012
@@ -73,14 +73,9 @@ public class TestSize extends BaseFuncto
         }
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testEvaluateNull() throws Exception {
-        try {
-            Size.instance().evaluate(null);
-            fail("Expected IllegalArgumentException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        Size.instance().evaluate(null);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java Mon Jan 23 21:18:10 2012
@@ -178,28 +178,20 @@ public class TestTransformedIterator ext
         assertSame(iter,TransformedIterator.maybeTransform(iter,null));
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testConstructorProhibitsNull() {
-        try {
-            new TransformedIterator<Integer, Integer>(null,null);
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
-        try {
-            new TransformedIterator<Integer, Integer>(null,negate);
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
-        try {
-            new TransformedIterator<Integer, Integer>(list.iterator(),null);
-            fail("ExpectedNullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        new TransformedIterator<Integer, Integer>(null, null);
     }
 
+    @Test(expected = NullPointerException.class)
+    public void testConstructorProhibitsNull2() {
+        new TransformedIterator<Integer, Integer>(null, negate);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testConstructorProhibitsNull3() {
+        new TransformedIterator<Integer, Integer>(list.iterator(), null);
+    }
 
     // Attributes
     // ------------------------------------------------------------------------

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsWithinRange.java Mon Jan 23 21:18:10 2012
@@ -56,25 +56,14 @@ public class TestIsWithinRange extends B
 
     }
 
-    @Test
+    @Test(expected = IllegalArgumentException.class)
     public void testInvalidRange() {
-        try {
-            new IsWithinRange<Integer>(new Integer(5), new Integer(4));
-            fail("should have thrown IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // good
-        } catch (Exception e) {
-            fail("should have thrown IllegalArgumentException, not " + e);
-        }
-
-        try {
-            new IsWithinRange<Integer>(new Integer(5), null);
-            fail("should have thrown IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // good
-        } catch (Exception e) {
-            fail("should have thrown IllegalArgumentException, not " + e);
-        }
+        new IsWithinRange<Integer>(new Integer(5), new Integer(4));
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testInvalidRange2() {
+        new IsWithinRange<Integer>(new Integer(5), null);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/composite/TestCompositeUnaryPredicate.java Mon Jan 23 21:18:10 2012
@@ -49,21 +49,15 @@ public class TestCompositeUnaryPredicate
         assertFalse(Composite.predicate(Constant.FALSE, Constant.of(4)).test("xyzzy"));
     }
 
-    @Test
-    @SuppressWarnings("unchecked")
+    @Test(expected = NullPointerException.class)
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public void testNullNotAllowed() throws Exception {
-        try {
-            new CompositeUnaryPredicate(null);
-            fail("Expected IllegalArgumentException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
-        try {
-            Composite.function(Constant.TRUE, null);
-            fail("Expected IllegalArgumentException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        new CompositeUnaryPredicate(null);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testNullNotAllowed2() throws Exception {
+        Composite.function(Constant.TRUE, null);
     }
 
     @Test

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java?rev=1234990&r1=1234989&r2=1234990&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java (original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/generator/TestIteratorToGeneratorAdapter.java Mon Jan 23 21:18:10 2012
@@ -84,14 +84,9 @@ public class TestIteratorToGeneratorAdap
         assertEquals(list,list2);
     }
 
-    @Test
+    @Test(expected = NullPointerException.class)
     public void testConstructNull() {
-        try {
-            new IteratorToGeneratorAdapter(null);
-            fail("Expected NullPointerException");
-        } catch(IllegalArgumentException e) {
-            // expected
-        }
+        new IteratorToGeneratorAdapter(null);
     }
 
     @Test