diff --git a/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java b/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java index eb73147ad..2d5f394c5 100644 --- a/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java +++ b/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java @@ -81,10 +81,9 @@ public class ReverseComparatorTest extends AbstractComparatorTest { * already "canonized" the comparator returned by makeComparator. */ @Override - @SuppressWarnings("unchecked") @Test public void testSerializeDeserializeThenCompare() throws Exception { - final Comparator comp = new ReverseComparator(new ComparableComparator()); + final Comparator comp = new ReverseComparator(new ComparableComparator()); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final ObjectOutputStream out = new ObjectOutputStream(buffer); diff --git a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java index f9d49bd6e..08df18aa8 100644 --- a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java +++ b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java @@ -237,8 +237,8 @@ public class MultiKeyTest extends TestCase { public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException { SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test"); - final MultiKey mk = new MultiKey(ONE, sysKey); - final Map map = new HashMap(); + final MultiKey mk = new MultiKey(ONE, sysKey); + final Map, Integer> map = new HashMap, Integer>(); map.put(mk, TWO); // serialize @@ -252,12 +252,12 @@ public class MultiKeyTest extends TestCase { final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); final ObjectInputStream in = new ObjectInputStream(bais); sysKey = (SystemHashCodeSimulatingKey)in.readObject(); // simulate deserialization in another process - final Map map2 = (Map) in.readObject(); + final Map map2 = (Map) in.readObject(); in.close(); assertEquals(2, sysKey.hashCode()); // different hashCode now - final MultiKey mk2 = new MultiKey(ONE, sysKey); + final MultiKey mk2 = new MultiKey(ONE, sysKey); assertEquals(TWO, map2.get(mk2)); } }