Author: erans Date: Sat Nov 6 23:40:43 2010 New Revision: 1032182 URL: http://svn.apache.org/viewvc?rev=1032182&view=rev Log: MATH-432 Added a test.
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/Pair.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/PairTest.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/Pair.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/Pair.java?rev=1032182&r1=1032181&r2=1032182&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/Pair.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/Pair.java Sat Nov 6 23:40:43 2010 @@ -87,7 +87,7 @@ public class Pair<K, V> { if (!(o instanceof Pair)) { return false; } else { - Pair<?, ?> oP = (Pair<?, ? >) o; + Pair<?, ?> oP = (Pair<?, ?>) o; return (key == null ? oP.getKey() == null : key.equals(oP.getKey())) && Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/PairTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/PairTest.java?rev=1032182&r1=1032181&r2=1032182&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/PairTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/PairTest.java Sat Nov 6 23:40:43 2010 @@ -42,5 +42,8 @@ public class PairTest { p2 = new Pair<Integer, Double>(new Integer(1), new Double(2)); Assert.assertTrue(p1.equals(p2)); + + Pair<Integer, Float> p3 = new Pair<Integer, Float>(new Integer(1), new Float(2)); + Assert.assertFalse(p1.equals(p3)); } }