Use valueOf().

This commit is contained in:
Gary Gregory 2021-05-25 13:38:02 -04:00
parent 2d86ac6ecf
commit b4a43380f1
3 changed files with 5 additions and 5 deletions

View File

@ -356,9 +356,9 @@ public class DiffBuilderTest {
@Test
public void testObjectsNotSameButEqual() {
final TypeTestClass left = new TypeTestClass();
left.objectField = new Integer(1);
left.objectField = Integer.valueOf(1);
final TypeTestClass right = new TypeTestClass();
right.objectField = new Integer(1);
right.objectField = Integer.valueOf(1);
assertNotSame(left.objectField, right.objectField);
assertEquals(left.objectField, right.objectField);

View File

@ -50,8 +50,8 @@ public class ImmutableTripleTest {
assertNull(triple2.getLeft());
assertEquals("bar", triple2.middle);
assertEquals("bar", triple2.getMiddle());
assertEquals(new Integer(42), triple2.right);
assertEquals(new Integer(42), triple2.getRight());
assertEquals(Integer.valueOf(42), triple2.right);
assertEquals(Integer.valueOf(42), triple2.getRight());
}
@Test

View File

@ -131,7 +131,7 @@ public class TripleTest {
assertTrue(triple2 instanceof ImmutableTriple<?, ?, ?>);
assertNull(((ImmutableTriple<Object, String, Long>) triple2).left);
assertEquals("bar", ((ImmutableTriple<Object, String, Long>) triple2).middle);
assertEquals(new Long(200L), ((ImmutableTriple<Object, String, Long>) triple2).right);
assertEquals(Long.valueOf(200L), ((ImmutableTriple<Object, String, Long>) triple2).right);
}
}