Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CC290160C26 for ; Wed, 3 Jan 2018 03:52:05 +0100 (CET) Received: (qmail 53836 invoked by uid 500); 3 Jan 2018 02:52:04 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 53827 invoked by uid 99); 3 Jan 2018 02:52:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2018 02:52:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 70E63E0014; Wed, 3 Jan 2018 02:52:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ggregory@apache.org To: commits@commons.apache.org Date: Wed, 03 Jan 2018 02:52:02 -0000 Message-Id: <9fc3f5128d8c49039c9d42b834a60147@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] commons-collections git commit: Use final. archived-at: Wed, 03 Jan 2018 02:52:07 -0000 Repository: commons-collections Updated Branches: refs/heads/master 9e62a0e99 -> 059c468f7 http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java index e8119f3..0cb9ba6 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java @@ -73,11 +73,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest list = new ArrayList<>(); + final List list = new ArrayList<>(); for (int j = 0; j < i; j++) { list.add(j); } - Iterator> it = new PermutationIterator<>(list); + final Iterator> it = new PermutationIterator<>(list); int count = 0; while (it.hasNext()) { it.next(); @@ -92,12 +92,12 @@ public class PermutationIteratorTest extends AbstractIteratorTest perm1 = new ArrayList<>(); - List perm2 = new ArrayList<>(); - List perm3 = new ArrayList<>(); - List perm4 = new ArrayList<>(); - List perm5 = new ArrayList<>(); - List perm6 = new ArrayList<>(); + final List perm1 = new ArrayList<>(); + final List perm2 = new ArrayList<>(); + final List perm3 = new ArrayList<>(); + final List perm4 = new ArrayList<>(); + final List perm5 = new ArrayList<>(); + final List perm6 = new ArrayList<>(); perm1.add('A'); perm2.add('A'); @@ -120,11 +120,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest> results = new ArrayList<>(); + final List> results = new ArrayList<>(); - PermutationIterator it = makeObject(); + final PermutationIterator it = makeObject(); while (it.hasNext()) { - List next = it.next(); + final List next = it.next(); results.add(next); } //3! permutation for 3 elements @@ -141,12 +141,12 @@ public class PermutationIteratorTest extends AbstractIteratorTest> resultsList = new ArrayList<>(); - Set> resultsSet = new HashSet<>(); + final List> resultsList = new ArrayList<>(); + final Set> resultsSet = new HashSet<>(); - PermutationIterator it = makeObject(); + final PermutationIterator it = makeObject(); while (it.hasNext()) { - List permutation = it.next(); + final List permutation = it.next(); resultsList.add(permutation); resultsSet.add(permutation); } @@ -156,24 +156,24 @@ public class PermutationIteratorTest extends AbstractIteratorTest> resultsList = new ArrayList<>(); + final List> resultsList = new ArrayList<>(); - PermutationIterator it = makeObject(); + final PermutationIterator it = makeObject(); while (it.hasNext()) { - List permutation = it.next(); + final List permutation = it.next(); resultsList.add(permutation); } //asking for another permutation should throw an exception try { it.next(); fail(); - } catch (NoSuchElementException e) { + } catch (final NoSuchElementException e) { // expected } } public void testPermutatorHasMore() { - PermutationIterator it = makeObject(); + final PermutationIterator it = makeObject(); for (int i = 0; i < 6; i++) { assertTrue(it.hasNext()); it.next(); @@ -182,11 +182,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest it = makeEmptyIterator(); + final PermutationIterator it = makeEmptyIterator(); // there is one permutation for an empty set: 0! = 1 assertTrue(it.hasNext()); - List nextPermutation = it.next(); + final List nextPermutation = it.next(); assertEquals(0, nextPermutation.size()); assertFalse(it.hasNext()); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java index 590fecf..668b00c 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java @@ -68,7 +68,7 @@ public class PushbackIteratorTest extends AbstractIteratorTest { @Test public void testNormalIteration() { - PushbackIterator iter = makeObject(); + final PushbackIterator iter = makeObject(); assertEquals("a", iter.next()); assertEquals("b", iter.next()); assertEquals("c", iter.next()); @@ -78,7 +78,7 @@ public class PushbackIteratorTest extends AbstractIteratorTest { @Test @SuppressWarnings("unchecked") public void testImmediatePushback() { - PushbackIterator iter = makeObject(); + final PushbackIterator iter = makeObject(); iter.pushback((E) "x"); assertEquals("x", iter.next()); assertEquals("a", iter.next()); @@ -88,7 +88,7 @@ public class PushbackIteratorTest extends AbstractIteratorTest { @Test @SuppressWarnings("unchecked") public void testDelayedPushback() { - PushbackIterator iter = makeObject(); + final PushbackIterator iter = makeObject(); assertEquals("a", iter.next()); iter.pushback((E) "x"); assertEquals("x", iter.next()); @@ -99,7 +99,7 @@ public class PushbackIteratorTest extends AbstractIteratorTest { @Test @SuppressWarnings("unchecked") public void testMultiplePushback() { - PushbackIterator iter = makeObject(); + final PushbackIterator iter = makeObject(); assertEquals("a", iter.next()); iter.pushback((E) "x"); iter.pushback((E) "y"); @@ -109,7 +109,7 @@ public class PushbackIteratorTest extends AbstractIteratorTest { validate(iter, "c"); } - private void validate(Iterator iter, Object... items) { + private void validate(final Iterator iter, final Object... items) { for (final Object x : items) { assertTrue(iter.hasNext()); assertEquals(x, iter.next()); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java index 052201a..c0ebf41 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java @@ -66,7 +66,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testSkipping() { - Iterator iter = new SkippingIterator<>(testList.iterator(), 2); + final Iterator iter = new SkippingIterator<>(testList.iterator(), 2); assertTrue(iter.hasNext()); assertEquals("c", iter.next()); @@ -83,7 +83,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -94,7 +94,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testSameAsDecorated() { - Iterator iter = new SkippingIterator<>(testList.iterator(), 0); + final Iterator iter = new SkippingIterator<>(testList.iterator(), 0); assertTrue(iter.hasNext()); assertEquals("a", iter.next()); @@ -115,7 +115,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -126,12 +126,12 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testOffsetGreaterThanSize() { - Iterator iter = new SkippingIterator<>(testList.iterator(), 10); + final Iterator iter = new SkippingIterator<>(testList.iterator(), 10); assertFalse(iter.hasNext()); try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -144,7 +144,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { new SkippingIterator<>(testList.iterator(), -1); fail("Expected IllegalArgumentException."); - } catch (IllegalArgumentException iae) { /* Success case */ + } catch (final IllegalArgumentException iae) { /* Success case */ } } @@ -154,13 +154,13 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveWithoutCallingNext() { - List testListCopy = new ArrayList<>(testList); - Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 1); + final List testListCopy = new ArrayList<>(testList); + final Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 1); try { iter.remove(); fail("Expected IllegalStateException."); - } catch (IllegalStateException ise) { /* Success case */ + } catch (final IllegalStateException ise) { /* Success case */ } } @@ -170,8 +170,8 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveCalledTwice() { - List testListCopy = new ArrayList<>(testList); - Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 1); + final List testListCopy = new ArrayList<>(testList); + final Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 1); assertTrue(iter.hasNext()); assertEquals("b", iter.next()); @@ -180,7 +180,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.remove(); fail("Expected IllegalStateException."); - } catch (IllegalStateException ise) { /* Success case */ + } catch (final IllegalStateException ise) { /* Success case */ } } @@ -190,8 +190,8 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveFirst() { - List testListCopy = new ArrayList<>(testList); - Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 4); + final List testListCopy = new ArrayList<>(testList); + final Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 4); assertTrue(iter.hasNext()); assertEquals("e", iter.next()); @@ -208,7 +208,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -218,8 +218,8 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveMiddle() { - List testListCopy = new ArrayList<>(testList); - Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 3); + final List testListCopy = new ArrayList<>(testList); + final Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 3); assertTrue(iter.hasNext()); assertEquals("d", iter.next()); @@ -238,7 +238,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -248,8 +248,8 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveLast() { - List testListCopy = new ArrayList<>(testList); - Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 5); + final List testListCopy = new ArrayList<>(testList); + final Iterator iter = new SkippingIterator<>(testListCopy.iterator(), 5); assertTrue(iter.hasNext()); assertEquals("f", iter.next()); @@ -260,7 +260,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } iter.remove(); @@ -270,7 +270,7 @@ public class SkippingIteratorTest extends AbstractIteratorTest { try { iter.next(); fail("Expected NoSuchElementException."); - } catch (NoSuchElementException nsee) { /* Success case */ + } catch (final NoSuchElementException nsee) { /* Success case */ } } @@ -280,20 +280,20 @@ public class SkippingIteratorTest extends AbstractIteratorTest { */ @Test public void testRemoveUnsupported() { - Iterator mockIterator = new AbstractIteratorDecorator(testList.iterator()) { + final Iterator mockIterator = new AbstractIteratorDecorator(testList.iterator()) { @Override public void remove() { throw new UnsupportedOperationException(); } }; - Iterator iter = new SkippingIterator<>(mockIterator, 1); + final Iterator iter = new SkippingIterator<>(mockIterator, 1); assertTrue(iter.hasNext()); assertEquals("b", iter.next()); try { iter.remove(); fail("Expected UnsupportedOperationException."); - } catch (UnsupportedOperationException usoe) { /* Success case */ + } catch (final UnsupportedOperationException usoe) { /* Success case */ } } } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java index 104acf2..59d3eb3 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java @@ -100,7 +100,7 @@ public class ZippingIteratorTest extends AbstractIteratorTest { final ZippingIterator iter = new ZippingIterator<>(odds.iterator(), evens.iterator()); for (int i = 0, j = 0; i < 20; i++) { assertTrue(iter.hasNext()); - int val = iter.next(); + final int val = iter.next(); if (i % 2 == 0) { assertEquals(odds.get(j).intValue(), val); } else { http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java ---------------------------------------------------------------------- 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 49159bd..dc7f2ec 100644 --- a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java +++ b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java @@ -258,7 +258,7 @@ public class MultiKeyTest extends TestCase { private static final long serialVersionUID = 1928896152249821416L; - public DerivedMultiKey(T key1, T key2) { + public DerivedMultiKey(final T key1, final T key2) { super(key1, key2); } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java index ccd53cd..15b608c 100644 --- a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java @@ -472,7 +472,7 @@ public abstract class AbstractListTest extends AbstractCollectionTest { final List list1 = getCollection(); final List list2 = getConfirmed(); - for (E element : list2) { + for (final E element : list2) { assertEquals("indexOf should return correct result", list1.indexOf(element), list2.indexOf(element)); verify(); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java index 01b5e2f..1207dc8 100644 --- a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java @@ -463,11 +463,11 @@ public class SetUniqueListTest extends AbstractListTest { public void testSubListIsUnmodifiable() { resetFull(); - List subList = getCollection().subList(1, 3); + final List subList = getCollection().subList(1, 3); try { subList.remove(0); fail("subList should be unmodifiable"); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { // expected } } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/list/TreeListTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java index b077b7a..5b0dba9 100644 --- a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java @@ -273,20 +273,20 @@ public class TreeListTest extends AbstractListTest { // when initializing the TreeList with another collection for (int size = 1; size < 1000; size++) { - List other = new ArrayList<>(size); + final List other = new ArrayList<>(size); for (int i = 0; i < size; i++) { other.add(i); } - TreeList l = new TreeList<>(other); - ListIterator it = l.listIterator(); + final TreeList l = new TreeList<>(other); + final ListIterator it = l.listIterator(); int i = 0; while (it.hasNext()) { - Integer val = it.next(); + final Integer val = it.next(); assertEquals(i++, val.intValue()); } while (it.hasPrevious()) { - Integer val = it.previous(); + final Integer val = it.previous(); assertEquals(--i, val.intValue()); } } @@ -301,28 +301,28 @@ public class TreeListTest extends AbstractListTest { // to simulate different cases in addAll, do different runs where // the number of elements already in the list and being added by addAll differ - int size = 1000; + final int size = 1000; for (int i = 0; i < 100; i++) { - List other = new ArrayList<>(size); + final List other = new ArrayList<>(size); for (int j = i; j < size; j++) { other.add(j); } - TreeList l = new TreeList<>(); + final TreeList l = new TreeList<>(); for (int j = 0; j < i; j++) { l.add(j); } l.addAll(other); - ListIterator it = l.listIterator(); + final ListIterator it = l.listIterator(); int cnt = 0; while (it.hasNext()) { - Integer val = it.next(); + final Integer val = it.next(); assertEquals(cnt++, val.intValue()); } while (it.hasPrevious()) { - Integer val = it.previous(); + final Integer val = it.previous(); assertEquals(--cnt, val.intValue()); } } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java index ccd1fc3..50c09af 100644 --- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java @@ -624,14 +624,14 @@ public abstract class AbstractMapTest extends AbstractObjectTest { final Object[] keys = getSampleKeys(); resetEmpty(); - for (Object key : keys) { + for (final Object key : keys) { assertTrue("Map must not contain key when map is empty", !getMap().containsKey(key)); } verify(); resetFull(); - for (Object key : keys) { + for (final Object key : keys) { assertTrue("Map must contain key for a mapping in the map. " + "Missing: " + key, getMap().containsKey(key)); } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java index 7a33ae4..86a9bb9 100644 --- a/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java @@ -90,7 +90,7 @@ public abstract class AbstractSortedMapTest extends AbstractMapTest public void testLastKey() { final SortedMap sm = makeFullMap(); K obj = null; - for (K k : sm.keySet()) { + for (final K k : sm.keySet()) { obj = k; } assertSame(obj, sm.lastKey()); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java index 46368c8..e7ed44c 100644 --- a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java @@ -74,42 +74,42 @@ public class LRUMapTest extends AbstractOrderedMapTest { try { new LRUMap(0); fail("maxSize must be positive"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } try { new LRUMap(-1, 12, 0.75f, false); fail("maxSize must be positive"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } try { new LRUMap(10, -1); fail("initialSize must not be negative"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } try { new LRUMap(10, 12); fail("initialSize must not be larger than maxSize"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } try { new LRUMap(10, -1, 0.75f, false); fail("initialSize must not be negative"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } try { new LRUMap(10, 12, 0.75f, false); fail("initialSize must not be larger than maxSize"); - } catch(IllegalArgumentException ex) { + } catch(final IllegalArgumentException ex) { // expected } } @@ -280,7 +280,7 @@ public class LRUMapTest extends AbstractOrderedMapTest { Iterator vit = null; resetEmpty(); - LRUMap lruMap = (LRUMap) map; + final LRUMap lruMap = (LRUMap) map; lruMap.put(keys[0], values[0]); lruMap.put(keys[1], values[1]); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java b/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java index a79227b..b0238c6 100644 --- a/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java @@ -386,13 +386,13 @@ public class ListOrderedMapTest extends AbstractOrderedMapTest { } public void testCOLLECTIONS_474_nullValues () { - Object key1 = new Object(); - Object key2 = new Object(); - HashMap hmap = new HashMap<>(); + final Object key1 = new Object(); + final Object key2 = new Object(); + final HashMap hmap = new HashMap<>(); hmap.put(key1, null); hmap.put(key2, null); assertEquals("Should have two elements", 2, hmap.size()); - ListOrderedMap listMap = new ListOrderedMap<>(); + final ListOrderedMap listMap = new ListOrderedMap<>(); listMap.put(key1, null); listMap.put(key2, null); assertEquals("Should have two elements", 2, listMap.size()); @@ -400,13 +400,13 @@ public class ListOrderedMapTest extends AbstractOrderedMapTest { } public void testCOLLECTIONS_474_nonNullValues () { - Object key1 = new Object(); - Object key2 = new Object(); - HashMap hmap = new HashMap<>(); + final Object key1 = new Object(); + final Object key2 = new Object(); + final HashMap hmap = new HashMap<>(); hmap.put(key1, "1"); hmap.put(key2, "2"); assertEquals("Should have two elements", 2, hmap.size()); - ListOrderedMap listMap = new ListOrderedMap<>(); + final ListOrderedMap listMap = new ListOrderedMap<>(); listMap.put(key1, "3"); listMap.put(key2, "4"); assertEquals("Should have two elements", 2, listMap.size()); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java index aae2239..dc57e0a 100644 --- a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java @@ -152,10 +152,11 @@ public class MultiValueMapTest extends AbstractObjectTest { public void testIterator() { final MultiValueMap map = createTestMap(); @SuppressWarnings("unchecked") + final Collection values = new ArrayList<>((Collection) map.values()); - Iterator> iterator = map.iterator(); + final Iterator> iterator = map.iterator(); while (iterator.hasNext()) { - Map.Entry entry = iterator.next(); + final Map.Entry entry = iterator.next(); assertTrue(map.containsValue(entry.getKey(), entry.getValue())); assertTrue(values.contains(entry.getValue())); assertTrue(values.remove(entry.getValue())); @@ -392,24 +393,24 @@ public class MultiValueMapTest extends AbstractObjectTest { } public void testUnsafeDeSerialization() throws Exception { - MultiValueMap map1 = MultiValueMap.multiValueMap(new HashMap(), ArrayList.class); + final MultiValueMap map1 = MultiValueMap.multiValueMap(new HashMap(), ArrayList.class); byte[] bytes = serialize(map1); Object result = deserialize(bytes); assertEquals(map1, result); - MultiValueMap map2 = MultiValueMap.multiValueMap(new HashMap(), (Class) String.class); + final MultiValueMap map2 = MultiValueMap.multiValueMap(new HashMap(), (Class) String.class); bytes = serialize(map2); try { result = deserialize(bytes); fail("unsafe clazz accepted when de-serializing MultiValueMap"); - } catch (UnsupportedOperationException ex) { + } catch (final UnsupportedOperationException ex) { // expected } } - private byte[] serialize(Object object) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); + private byte[] serialize(final Object object) throws IOException { + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(object); oos.close(); @@ -417,9 +418,9 @@ public class MultiValueMapTest extends AbstractObjectTest { return baos.toByteArray(); } - private Object deserialize(byte[] data) throws IOException, ClassNotFoundException { - ByteArrayInputStream bais = new ByteArrayInputStream(data); - ObjectInputStream iis = new ObjectInputStream(bais); + private Object deserialize(final byte[] data) throws IOException, ClassNotFoundException { + final ByteArrayInputStream bais = new ByteArrayInputStream(data); + final ObjectInputStream iis = new ObjectInputStream(bais); return iis.readObject(); } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java index 789d294..f09105c 100644 --- a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java @@ -234,14 +234,14 @@ public class PassiveExpiringMapTest extends AbstractMapTest { new PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy(1, TimeUnit.SECONDS)), 1000); } - private void validateExpiration(final Map map, long timeout) { + private void validateExpiration(final Map map, final long timeout) { map.put("a", "b"); assertNotNull(map.get("a")); try { Thread.sleep(2 * timeout); - } catch (InterruptedException e) { + } catch (final InterruptedException e) { fail(); } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java index 286c0b3..260947c 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java @@ -32,7 +32,7 @@ import org.apache.commons.collections4.MultiValuedMap; */ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest { - public ArrayListValuedHashMapTest(String testName) { + public ArrayListValuedHashMapTest(final String testName) { super(testName); } @@ -51,7 +51,7 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest public void testListValuedMapAdd() { final ListValuedMap listMap = makeObject(); assertTrue(listMap.get((K) "whatever") instanceof List); - List list = listMap.get((K) "A"); + final List list = listMap.get((K) "A"); list.add((V) "a1"); assertEquals(1, listMap.size()); assertTrue(listMap.containsKey("A")); @@ -60,7 +60,7 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest @SuppressWarnings("unchecked") public void testListValuedMapAddViaListIterator() { final ListValuedMap listMap = makeObject(); - ListIterator listIt = listMap.get((K) "B").listIterator(); + final ListIterator listIt = listMap.get((K) "B").listIterator(); assertFalse(listIt.hasNext()); listIt.add((V) "b1"); listIt.add((V) "b2"); @@ -74,7 +74,7 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest @SuppressWarnings("unchecked") public void testListValuedMapRemove() { final ListValuedMap listMap = makeObject(); - List list = listMap.get((K) "A"); + final List list = listMap.get((K) "A"); list.add((V) "a1"); list.add((V) "a2"); list.add((V) "a3"); @@ -110,8 +110,8 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest @SuppressWarnings({ "unchecked", "rawtypes" }) public void testEqualsHashCodeContract() { - MultiValuedMap map1 = makeObject(); - MultiValuedMap map2 = makeObject(); + final MultiValuedMap map1 = makeObject(); + final MultiValuedMap map2 = makeObject(); map1.put("a", "a1"); map1.put("a", "a2"); @@ -127,8 +127,8 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest @SuppressWarnings({ "unchecked", "rawtypes" }) public void testListValuedMapEqualsHashCodeContract() { - ListValuedMap map1 = makeObject(); - ListValuedMap map2 = makeObject(); + final ListValuedMap map1 = makeObject(); + final ListValuedMap map2 = makeObject(); map1.put("a", "a1"); map1.put("a", "a2"); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java index 61d5538..2a46641 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java @@ -32,7 +32,7 @@ import org.apache.commons.collections4.SetValuedMap; */ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest { - public HashSetValuedHashMapTest(String testName) { + public HashSetValuedHashMapTest(final String testName) { super(testName); } @@ -57,7 +57,7 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest setMap = makeObject(); assertTrue(setMap.get((K) "whatever") instanceof Set); - Set set = setMap.get((K) "A"); + final Set set = setMap.get((K) "A"); assertTrue(set.add((V) "a1")); assertTrue(set.add((V) "a2")); assertFalse(set.add((V) "a1")); @@ -70,7 +70,7 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest setMap = makeObject(); assertTrue(setMap.get((K) "whatever") instanceof Set); - Set set = setMap.get((K) "A"); + final Set set = setMap.get((K) "A"); assertTrue(set.add((V) "a1")); assertTrue(set.add((V) "a2")); assertFalse(set.add((V) "a1")); @@ -90,12 +90,12 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest setMap = makeObject(); assertTrue(setMap.get((K) "whatever") instanceof Set); - Set set = setMap.get((K) "A"); + final Set set = setMap.get((K) "A"); set.add((V) "a1"); set.add((V) "a2"); set.add((V) "a1"); - Iterator it = set.iterator(); + final Iterator it = set.iterator(); while (it.hasNext()) { it.next(); it.remove(); @@ -106,8 +106,8 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest extends AbstractMultiValuedMapTest { - public TransformedMultiValuedMapTest(String testName) { + public TransformedMultiValuedMapTest(final String testName) { super(testName); } @@ -53,7 +53,7 @@ public class TransformedMultiValuedMapTest extends AbstractMultiValuedMapT public void testKeyTransformedMap() { final Object[] els = new Object[] { "1", "3", "5", "7", "2", "4", "6" }; - MultiValuedMap map = TransformedMultiValuedMap.transformingMap( + final MultiValuedMap map = TransformedMultiValuedMap.transformingMap( new ArrayListValuedHashMap(), (Transformer) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER, null); @@ -67,7 +67,7 @@ public class TransformedMultiValuedMapTest extends AbstractMultiValuedMapT assertEquals(true, map.get((K) Integer.valueOf((String) els[i])).contains(els[i])); } - Collection coll = map.remove(els[0]); + final Collection coll = map.remove(els[0]); assertNotNull(coll); assertEquals(0, coll.size()); assertEquals(true, map.remove(Integer.valueOf((String) els[0])).contains(els[0])); @@ -77,7 +77,7 @@ public class TransformedMultiValuedMapTest extends AbstractMultiValuedMapT public void testValueTransformedMap() { final Object[] els = new Object[] { "1", "3", "5", "7", "2", "4", "6" }; - MultiValuedMap map = TransformedMultiValuedMap.transformingMap( + final MultiValuedMap map = TransformedMultiValuedMap.transformingMap( new ArrayListValuedHashMap(), null, (Transformer) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER); assertEquals(0, map.size()); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java index 9818e12..260d9ae 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java @@ -38,7 +38,7 @@ import org.apache.commons.collections4.Unmodifiable; */ public class UnmodifiableMultiValuedMapTest extends AbstractMultiValuedMapTest { - public UnmodifiableMultiValuedMapTest(String testName) { + public UnmodifiableMultiValuedMapTest(final String testName) { super(testName); } @@ -85,179 +85,179 @@ public class UnmodifiableMultiValuedMapTest extends AbstractMultiValuedMap try { UnmodifiableMultiValuedMap.unmodifiableMultiValuedMap(null); fail("map must not be null"); - } catch (NullPointerException e) { + } catch (final NullPointerException e) { // expected } } @SuppressWarnings("unchecked") public void testAddException() { - MultiValuedMap map = makeObject(); + final MultiValuedMap map = makeObject(); try { map.put((K) "one", (V) "uno"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableEntries() { resetFull(); - Collection> entries = getMap().entries(); + final Collection> entries = getMap().entries(); try { entries.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } - Iterator> it = entries.iterator(); - Entry entry = it.next(); + final Iterator> it = entries.iterator(); + final Entry entry = it.next(); try { it.remove(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { entry.setValue((V) "three"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableMapIterator() { resetFull(); - MapIterator mapIt = getMap().mapIterator(); + final MapIterator mapIt = getMap().mapIterator(); try { mapIt.remove(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { mapIt.setValue((V) "three"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableKeySet() { resetFull(); - Set keySet = getMap().keySet(); + final Set keySet = getMap().keySet(); try { keySet.add((K) "four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { keySet.remove("four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { keySet.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } - Iterator it = keySet.iterator(); + final Iterator it = keySet.iterator(); try { it.remove(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableValues() { resetFull(); - Collection values = getMap().values(); + final Collection values = getMap().values(); try { values.add((V) "four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { values.remove("four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { values.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } - Iterator it = values.iterator(); + final Iterator it = values.iterator(); try { it.remove(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableAsMap() { resetFull(); - Map> mapCol = getMap().asMap(); + final Map> mapCol = getMap().asMap(); try { mapCol.put((K) "four", (Collection) Arrays.asList("four")); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { mapCol.remove("four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { mapCol.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { mapCol.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } @SuppressWarnings("unchecked") public void testUnmodifiableKeys() { resetFull(); - MultiSet keys = getMap().keys(); + final MultiSet keys = getMap().keys(); try { keys.add((K) "four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { keys.remove("four"); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } try { keys.clear(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } - Iterator it = keys.iterator(); + final Iterator it = keys.iterator(); try { it.remove(); fail(); - } catch (UnsupportedOperationException e) { + } catch (final UnsupportedOperationException e) { } } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java index 7ae0e7b..9c41c38 100644 --- a/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java +++ b/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java @@ -72,7 +72,7 @@ public abstract class AbstractQueueTest extends AbstractCollectionTest { public void verify() { super.verify(); final Iterator iterator1 = getCollection().iterator(); - for (E e : getConfirmed()) { + for (final E e : getConfirmed()) { assertTrue(iterator1.hasNext()); final Object o1 = iterator1.next(); final Object o2 = e; http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java index ac51874..e38ade4 100644 --- a/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java +++ b/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java @@ -48,7 +48,7 @@ public class CircularFifoQueueTest extends AbstractQueueTest { public void verify() { super.verify(); final Iterator iterator1 = getCollection().iterator(); - for (E e : getConfirmed()) { + for (final E e : getConfirmed()) { assertTrue(iterator1.hasNext()); final Object o1 = iterator1.next(); final Object o2 = e; http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java b/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java index f2795ec..88bb25a 100644 --- a/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java +++ b/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java @@ -130,7 +130,7 @@ public class SequencesComparatorTest { final ExecutionVisitor ev = new ExecutionVisitor<>(); for (int i = 0; i < shadokSentences.size(); ++i) { - for (List shadokSentence : shadokSentences) { + for (final List shadokSentence : shadokSentences) { ev.setList(shadokSentences.get(i)); new SequencesComparator<>(shadokSentences.get(i), shadokSentence).getScript().visit(ev); http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java b/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java index cea912a..089b919 100644 --- a/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java @@ -62,7 +62,7 @@ public abstract class AbstractSetTest extends AbstractCollectionTest { assertEquals("Sets should have equal hashCodes", getConfirmed().hashCode(), getCollection().hashCode()); final Collection set = makeConfirmedCollection(); - for (E element : getCollection()) { + for (final E element : getCollection()) { assertTrue("Set.iterator should only return unique elements", set.add(element)); } } http://git-wip-us.apache.org/repos/asf/commons-collections/blob/059c468f/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java index cbe8023..04cb3ad 100755 --- a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java +++ b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java @@ -331,7 +331,7 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { public void testPrefixMapSizes() { // COLLECTIONS-525 - PatriciaTrie aTree = new PatriciaTrie<>(); + final PatriciaTrie aTree = new PatriciaTrie<>(); aTree.put("点评", "测试"); aTree.put("书评", "测试"); assertTrue(aTree.prefixMap("点").containsKey("点评")); @@ -370,7 +370,7 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { } public void testPrefixMapClear() { - Trie trie = new PatriciaTrie<>(); + final Trie trie = new PatriciaTrie<>(); trie.put("Anna", 1); trie.put("Anael", 2); trie.put("Analu", 3); @@ -378,7 +378,7 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { trie.put("Andrea", 5); trie.put("Andres", 6); trie.put("Anatole", 7); - SortedMap prefixMap = trie.prefixMap("And"); + final SortedMap prefixMap = trie.prefixMap("And"); assertEquals(new HashSet<>(Arrays.asList("Andrea", "Andreas", "Andres")), prefixMap.keySet()); assertEquals(Arrays.asList(5, 4, 6), new ArrayList<>(prefixMap.values())); @@ -391,8 +391,8 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { } public void testPrefixMapClearNothing() { - Trie trie = new PatriciaTrie<>(); - SortedMap prefixMap = trie.prefixMap("And"); + final Trie trie = new PatriciaTrie<>(); + final SortedMap prefixMap = trie.prefixMap("And"); assertEquals(new HashSet(), prefixMap.keySet()); assertEquals(new ArrayList(0), new ArrayList<>(prefixMap.values())); @@ -405,7 +405,7 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { } public void testPrefixMapClearUsingRemove() { - Trie trie = new PatriciaTrie<>(); + final Trie trie = new PatriciaTrie<>(); trie.put("Anna", 1); trie.put("Anael", 2); trie.put("Analu", 3); @@ -413,11 +413,11 @@ public class PatriciaTrieTest extends AbstractSortedMapTest { trie.put("Andrea", 5); trie.put("Andres", 6); trie.put("Anatole", 7); - SortedMap prefixMap = trie.prefixMap("And"); + final SortedMap prefixMap = trie.prefixMap("And"); assertEquals(new HashSet<>(Arrays.asList("Andrea", "Andreas", "Andres")), prefixMap.keySet()); assertEquals(Arrays.asList(5, 4, 6), new ArrayList<>(prefixMap.values())); - Set keys = new HashSet<>(prefixMap.keySet()); + final Set keys = new HashSet<>(prefixMap.keySet()); for (final String key : keys) { prefixMap.remove(key); }