Rename local variables to not hide the constants from lines 46, 47
This commit is contained in:
parent
7ad893360d
commit
6c3bba1c23
|
@ -81,25 +81,25 @@ public class ListUtilsTest {
|
||||||
public void testEquals() {
|
public void testEquals() {
|
||||||
final Collection<String> data = Arrays.asList("a", "b", "c");
|
final Collection<String> data = Arrays.asList("a", "b", "c");
|
||||||
|
|
||||||
final List<String> a = new ArrayList<>( data );
|
final List<String> list1 = new ArrayList<>( data );
|
||||||
final List<String> b = new ArrayList<>( data );
|
final List<String> list2 = new ArrayList<>( data );
|
||||||
|
|
||||||
assertEquals(a, b);
|
assertEquals(list1, list2);
|
||||||
assertTrue(ListUtils.isEqualList(a, b));
|
assertTrue(ListUtils.isEqualList(list1, list2));
|
||||||
a.clear();
|
list1.clear();
|
||||||
assertFalse(ListUtils.isEqualList(a, b));
|
assertFalse(ListUtils.isEqualList(list1, list2));
|
||||||
assertFalse(ListUtils.isEqualList(a, null));
|
assertFalse(ListUtils.isEqualList(list1, null));
|
||||||
assertFalse(ListUtils.isEqualList(null, b));
|
assertFalse(ListUtils.isEqualList(null, list2));
|
||||||
assertTrue(ListUtils.isEqualList(null, null));
|
assertTrue(ListUtils.isEqualList(null, null));
|
||||||
|
|
||||||
b.clear();
|
list2.clear();
|
||||||
a.add("a");
|
list1.add("a");
|
||||||
b.add("b");
|
list2.add("b");
|
||||||
assertFalse(ListUtils.isEqualList(a, b));
|
assertFalse(ListUtils.isEqualList(list1, list2));
|
||||||
|
|
||||||
a.add("b");
|
list1.add("b");
|
||||||
b.add("a");
|
list2.add("a");
|
||||||
assertFalse(ListUtils.isEqualList(a, b));
|
assertFalse(ListUtils.isEqualList(list1, list2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -120,19 +120,19 @@ public class ListUtilsTest {
|
||||||
public void testHashCode() {
|
public void testHashCode() {
|
||||||
final Collection<String> data = Arrays.asList("a", "b", "c");
|
final Collection<String> data = Arrays.asList("a", "b", "c");
|
||||||
|
|
||||||
final List<String> a = new ArrayList<>(data);
|
final List<String> list1 = new ArrayList<>(data);
|
||||||
final List<String> b = new ArrayList<>(data);
|
final List<String> list2 = new ArrayList<>(data);
|
||||||
|
|
||||||
assertEquals(a.hashCode(), b.hashCode());
|
assertEquals(list1.hashCode(), list2.hashCode());
|
||||||
assertEquals(a.hashCode(), ListUtils.hashCodeForList(a));
|
assertEquals(list1.hashCode(), ListUtils.hashCodeForList(list1));
|
||||||
assertEquals(b.hashCode(), ListUtils.hashCodeForList(b));
|
assertEquals(list2.hashCode(), ListUtils.hashCodeForList(list2));
|
||||||
assertEquals(ListUtils.hashCodeForList(a), ListUtils.hashCodeForList(b));
|
assertEquals(ListUtils.hashCodeForList(list1), ListUtils.hashCodeForList(list2));
|
||||||
a.clear();
|
list1.clear();
|
||||||
assertNotEquals(ListUtils.hashCodeForList(a), ListUtils.hashCodeForList(b));
|
assertNotEquals(ListUtils.hashCodeForList(list1), ListUtils.hashCodeForList(list2));
|
||||||
assertEquals(0, ListUtils.hashCodeForList(null));
|
assertEquals(0, ListUtils.hashCodeForList(null));
|
||||||
|
|
||||||
a.add(null);
|
list1.add(null);
|
||||||
assertEquals(31, ListUtils.hashCodeForList(a));
|
assertEquals(31, ListUtils.hashCodeForList(list1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue