Added a test.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1032182 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2010-11-06 23:40:43 +00:00
parent 36b8beb614
commit 61499e8725
2 changed files with 4 additions and 1 deletions

View File

@ -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())) &&

View File

@ -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));
}
}