You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/01/07 18:15:24 UTC

svn commit: r1429905 [26/26] - in /commons/proper/collections/trunk/src: main/java/org/apache/commons/collections/ main/java/org/apache/commons/collections/bag/ main/java/org/apache/commons/collections/bidimap/ main/java/org/apache/commons/collections/...

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSetTest.java Mon Jan  7 17:15:14 2013
@@ -31,7 +31,7 @@ import org.apache.commons.collections.fu
  */
 public class PredicatedSetTest<E> extends AbstractSetTest<E> {
 
-    public PredicatedSetTest(String testName) {
+    public PredicatedSetTest(final String testName) {
         super(testName);
     }
 
@@ -39,7 +39,7 @@ public class PredicatedSetTest<E> extend
 
     protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
 
-    protected PredicatedSet<E> decorateSet(Set<E> set, Predicate<? super E> predicate) {
+    protected PredicatedSet<E> decorateSet(final Set<E> set, final Predicate<? super E> predicate) {
         return PredicatedSet.predicatedSet(set, predicate);
     }
 
@@ -58,7 +58,7 @@ public class PredicatedSetTest<E> extend
 
     protected Predicate<E> testPredicate =
         new Predicate<E>() {
-            public boolean evaluate(E o) {
+            public boolean evaluate(final E o) {
                 return o instanceof String;
             }
         };
@@ -68,18 +68,18 @@ public class PredicatedSetTest<E> extend
     }
 
     public void testGetSet() {
-        PredicatedSet<E> set = makeTestSet();
+        final PredicatedSet<E> set = makeTestSet();
         assertTrue("returned set should not be null", set.decorated() != null);
     }
 
     @SuppressWarnings("unchecked")
     public void testIllegalAdd() {
-        Set<E> set = makeTestSet();
-        Integer i = new Integer(3);
+        final Set<E> set = makeTestSet();
+        final Integer i = new Integer(3);
         try {
             set.add((E) i);
             fail("Integer should fail string predicate.");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         assertTrue("Collection shouldn't contain illegal element",
@@ -88,8 +88,8 @@ public class PredicatedSetTest<E> extend
 
     @SuppressWarnings("unchecked")
     public void testIllegalAddAll() {
-        Set<E> set = makeTestSet();
-        Set<E> elements = new HashSet<E>();
+        final Set<E> set = makeTestSet();
+        final Set<E> elements = new HashSet<E>();
         elements.add((E) "one");
         elements.add((E) "two");
         elements.add((E) new Integer(3));
@@ -97,7 +97,7 @@ public class PredicatedSetTest<E> extend
         try {
             set.addAll(elements);
             fail("Integer should fail string predicate.");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         assertTrue("Set shouldn't contain illegal element",

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSortedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSortedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSortedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/PredicatedSortedSetTest.java Mon Jan  7 17:15:14 2013
@@ -37,7 +37,7 @@ import org.apache.commons.collections.fu
  */
 public class PredicatedSortedSetTest<E> extends AbstractSortedSetTest<E> {
 
-    public PredicatedSortedSetTest(String testName) {
+    public PredicatedSortedSetTest(final String testName) {
         super(testName);
     }
 
@@ -56,7 +56,7 @@ public class PredicatedSortedSetTest<E> 
 
     @Override
     public SortedSet<E> makeFullCollection() {
-        TreeSet<E> set = new TreeSet<E>();
+        final TreeSet<E> set = new TreeSet<E>();
         set.addAll(Arrays.asList(getFullElements()));
         return PredicatedSortedSet.predicatedSortedSet(set, truePredicate);
     }
@@ -64,7 +64,7 @@ public class PredicatedSortedSetTest<E> 
 //--------------------------------------------------------------------
     protected Predicate<E> testPredicate =
         new Predicate<E>() {
-            public boolean evaluate(E o) {
+            public boolean evaluate(final E o) {
                 return o instanceof String && ((String) o).startsWith("A");
             }
         };
@@ -74,18 +74,18 @@ public class PredicatedSortedSetTest<E> 
     }
 
     public void testGetSet() {
-        PredicatedSortedSet<E> set = makeTestSet();
+        final PredicatedSortedSet<E> set = makeTestSet();
         assertTrue("returned set should not be null", set.decorated() != null);
     }
 
     @SuppressWarnings("unchecked")
     public void testIllegalAdd() {
-        SortedSet<E> set = makeTestSet();
-        String testString = "B";
+        final SortedSet<E> set = makeTestSet();
+        final String testString = "B";
         try {
             set.add((E) testString);
             fail("Should fail string predicate.");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         assertTrue("Collection shouldn't contain illegal element",
@@ -94,8 +94,8 @@ public class PredicatedSortedSetTest<E> 
 
     @SuppressWarnings("unchecked")
     public void testIllegalAddAll() {
-        SortedSet<E> set = makeTestSet();
-        Set<E> elements = new TreeSet<E>();
+        final SortedSet<E> set = makeTestSet();
+        final Set<E> elements = new TreeSet<E>();
         elements.add((E) "Aone");
         elements.add((E) "Atwo");
         elements.add((E) "Bthree");
@@ -103,7 +103,7 @@ public class PredicatedSortedSetTest<E> 
         try {
             set.addAll(elements);
             fail("Should fail string predicate.");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         assertTrue("Set shouldn't contain illegal element", !set.contains("Aone"));
@@ -113,8 +113,8 @@ public class PredicatedSortedSetTest<E> 
     }
 
     public void testComparator() {
-        SortedSet<E> set = makeTestSet();
-        Comparator<? super E> c = set.comparator();
+        final SortedSet<E> set = makeTestSet();
+        final Comparator<? super E> c = set.comparator();
         assertTrue("natural order, so comparator should be null", c == null);
     }
 

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSetTest.java Mon Jan  7 17:15:14 2013
@@ -32,7 +32,7 @@ import org.apache.commons.collections.Bu
  */
 public class SynchronizedSetTest<E> extends AbstractSetTest<E> {
 
-    public SynchronizedSetTest(String testName) {
+    public SynchronizedSetTest(final String testName) {
         super(testName);
     }
 

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSortedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSortedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSortedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSortedSetTest.java Mon Jan  7 17:15:14 2013
@@ -32,7 +32,7 @@ import org.apache.commons.collections.Bu
  */
 public class SynchronizedSortedSetTest<E> extends AbstractSortedSetTest<E> {
 
-    public SynchronizedSortedSetTest(String testName) {
+    public SynchronizedSortedSetTest(final String testName) {
         super(testName);
     }
 

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSetTest.java Mon Jan  7 17:15:14 2013
@@ -32,7 +32,7 @@ import org.apache.commons.collections.co
  */
 public class TransformedSetTest<E> extends AbstractSetTest<E> {
 
-    public TransformedSetTest(String testName) {
+    public TransformedSetTest(final String testName) {
         super(testName);
     }
 
@@ -43,7 +43,7 @@ public class TransformedSetTest<E> exten
 
     @Override
     public Set<E> makeConfirmedFullCollection() {
-        Set<E> set = new HashSet<E>();
+        final Set<E> set = new HashSet<E>();
         set.addAll(Arrays.asList(getFullElements()));
         return set;
     }
@@ -58,7 +58,7 @@ public class TransformedSetTest<E> exten
     @Override
     @SuppressWarnings("unchecked")
     public Set<E> makeFullCollection() {
-        Set<E> list = new HashSet<E>();
+        final Set<E> list = new HashSet<E>();
         list.addAll(Arrays.asList(getFullElements()));
         return TransformedSet.transformingSet(list,
                 (Transformer<E, E>) TransformedCollectionTest.NOOP_TRANSFORMER);
@@ -66,10 +66,10 @@ public class TransformedSetTest<E> exten
 
     @SuppressWarnings("unchecked")
     public void testTransformedSet() {
-        Set<E> set = TransformedSet.transformingSet(new HashSet<E>(),
+        final Set<E> set = TransformedSet.transformingSet(new HashSet<E>(),
                 (Transformer<E, E>) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
         assertEquals(0, set.size());
-        E[] els = (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" };
+        final E[] els = (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" };
         for (int i = 0; i < els.length; i++) {
             set.add(els[i]);
             assertEquals(i + 1, set.size());
@@ -83,14 +83,14 @@ public class TransformedSetTest<E> exten
     }
 
     public void testTransformedSet_decorateTransform() {
-        Set<Object> originalSet = new HashSet<Object>();
-        Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
-        for (Object el : els) {
+        final Set<Object> originalSet = new HashSet<Object>();
+        final Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
+        for (final Object el : els) {
             originalSet.add(el);
         }
-        Set<?> set = TransformedSet.transformedSet(originalSet, TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
+        final Set<?> set = TransformedSet.transformedSet(originalSet, TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
         assertEquals(els.length, set.size());
-        for (Object el : els) {
+        for (final Object el : els) {
             assertEquals(true, set.contains(new Integer((String) el)));
             assertEquals(false, set.contains(el));
         }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSortedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSortedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSortedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/TransformedSortedSetTest.java Mon Jan  7 17:15:14 2013
@@ -36,7 +36,7 @@ import org.apache.commons.collections.co
  */
 public class TransformedSortedSetTest<E> extends AbstractSortedSetTest<E> {
 
-    public TransformedSortedSetTest(String testName) {
+    public TransformedSortedSetTest(final String testName) {
         super(testName);
     }
 
@@ -54,7 +54,7 @@ public class TransformedSortedSetTest<E>
     @Override
     @SuppressWarnings("unchecked")
     public SortedSet<E> makeFullCollection() {
-        SortedSet<E> set = new TreeSet<E>();
+        final SortedSet<E> set = new TreeSet<E>();
         set.addAll(Arrays.asList(getFullElements()));
         return TransformedSortedSet.transformingSortedSet(set, (Transformer<E, E>) TransformedCollectionTest.NOOP_TRANSFORMER);
     }
@@ -62,10 +62,10 @@ public class TransformedSortedSetTest<E>
     //-----------------------------------------------------------------------
     @SuppressWarnings("unchecked")
     public void testTransformedSet() {
-        SortedSet<E> set = TransformedSortedSet.transformingSortedSet(new TreeSet<E>(),
+        final SortedSet<E> set = TransformedSortedSet.transformingSortedSet(new TreeSet<E>(),
                 (Transformer<E, E>) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
         assertEquals(0, set.size());
-        E[] els = (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" };
+        final E[] els = (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" };
         for (int i = 0; i < els.length; i++) {
             set.add(els[i]);
             assertEquals(i + 1, set.size());
@@ -76,14 +76,14 @@ public class TransformedSortedSetTest<E>
     }
 
     public void testTransformedSet_decorateTransform() {
-        Set<Object> originalSet = new TreeSet<Object>();
-        Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
-        for (Object el : els) {
+        final Set<Object> originalSet = new TreeSet<Object>();
+        final Object[] els = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
+        for (final Object el : els) {
             originalSet.add(el);
         }
-        Set<?> set = TransformedSortedSet.transformedSet(originalSet, TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
+        final Set<?> set = TransformedSortedSet.transformedSet(originalSet, TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
         assertEquals(els.length, set.size());
-        for (Object el : els) {
+        for (final Object el : els) {
             assertEquals(true, set.contains(new Integer((String) el)));
         }
         

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSetTest.java Mon Jan  7 17:15:14 2013
@@ -33,7 +33,7 @@ import org.apache.commons.collections.Bu
  */
 public class UnmodifiableSetTest<E> extends AbstractSetTest<E> {
 
-    public UnmodifiableSetTest(String testName) {
+    public UnmodifiableSetTest(final String testName) {
         super(testName);
     }
 
@@ -49,7 +49,7 @@ public class UnmodifiableSetTest<E> exte
 
     @Override
     public Set<E> makeFullCollection() {
-        HashSet<E> set = new HashSet<E>();
+        final HashSet<E> set = new HashSet<E>();
         set.addAll(Arrays.asList(getFullElements()));
         return UnmodifiableSet.unmodifiableSet(set);
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSortedSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSortedSetTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSortedSetTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/UnmodifiableSortedSetTest.java Mon Jan  7 17:15:14 2013
@@ -38,7 +38,7 @@ public class UnmodifiableSortedSetTest<E
     protected UnmodifiableSortedSet<E> set = null;
     protected ArrayList<E> array = null;
 
-    public UnmodifiableSortedSetTest(String testName) {
+    public UnmodifiableSortedSetTest(final String testName) {
         super(testName);
     }
 
@@ -54,7 +54,7 @@ public class UnmodifiableSortedSetTest<E
 
     @Override
     public UnmodifiableSortedSet<E> makeFullCollection() {
-        TreeSet<E> set = new TreeSet<E>();
+        final TreeSet<E> set = new TreeSet<E>();
         set.addAll(Arrays.asList(getFullElements()));
         return (UnmodifiableSortedSet<E>) UnmodifiableSortedSet.unmodifiableSortedSet(set);
     }
@@ -93,48 +93,48 @@ public class UnmodifiableSortedSetTest<E
      * Verifies that a set is not modifiable
      */
     @SuppressWarnings("unchecked")
-    public void verifyUnmodifiable(Set<E> set) {
+    public void verifyUnmodifiable(final Set<E> set) {
         try {
             set.add((E) "value");
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         try {
             set.addAll(new TreeSet<E>());
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         try {
             set.clear();
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         try {
             set.remove("x");
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         try {
             set.removeAll(array);
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         try {
             set.retainAll(array);
             fail("Expecting UnsupportedOperationException.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
     }
 
     public void testComparator() {
         setupSet();
-        Comparator<? super E> c = set.comparator();
+        final Comparator<? super E> c = set.comparator();
         assertTrue("natural order, so comparator should be null", c == null);
     }
 

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/splitmap/TransformedMapTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/splitmap/TransformedMapTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/splitmap/TransformedMapTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/splitmap/TransformedMapTest.java Mon Jan  7 17:15:14 2013
@@ -36,35 +36,35 @@ import org.apache.commons.collections.fu
 @SuppressWarnings("boxing")
 public class TransformedMapTest extends BulkTest {
 
-    private Transformer<Integer, String> intToString = new Transformer<Integer, String>() {
-        public String transform(Integer input) {
+    private final Transformer<Integer, String> intToString = new Transformer<Integer, String>() {
+        public String transform(final Integer input) {
             return String.valueOf(input);
         }
     };
 
-    private Transformer<Object, Class<?>> objectToClass = new Transformer<Object, Class<?>>() {
-        public java.lang.Class<?> transform(Object input) {
+    private final Transformer<Object, Class<?>> objectToClass = new Transformer<Object, Class<?>>() {
+        public java.lang.Class<?> transform(final Object input) {
             return input == null ? null : input.getClass();
         }
     };
 
-    private Transformer<String, Integer> stringToInt = new Transformer<String, Integer>() {
-        public Integer transform(String input) {
+    private final Transformer<String, Integer> stringToInt = new Transformer<String, Integer>() {
+        public Integer transform(final String input) {
             return Integer.valueOf(input);
         }
     };
 
-    public TransformedMapTest(String testName) {
+    public TransformedMapTest(final String testName) {
         super(testName);
     }
 
     // -----------------------------------------------------------------------
     public void testTransformedMap() {
-        TransformedMap<Integer, String, Object, Class<?>> map = TransformedMap.transformingMap(
+        final TransformedMap<Integer, String, Object, Class<?>> map = TransformedMap.transformingMap(
                 new HashMap<String, Class<?>>(), intToString, objectToClass);
 
-        Integer[] k = new Integer[] { 0, 1, 2, 3, 4, 5, 6 };
-        Object[] v = new Object[] { "", new Object(), new HashMap<Object, Object>(), 0, BigInteger.TEN, null,
+        final Integer[] k = new Integer[] { 0, 1, 2, 3, 4, 5, 6 };
+        final Object[] v = new Object[] { "", new Object(), new HashMap<Object, Object>(), 0, BigInteger.TEN, null,
                 new Object[0] };
 
         assertEquals(0, map.size());
@@ -84,7 +84,7 @@ public class TransformedMapTest extends 
         assertEquals(objectToClass.transform(v[0]), map.remove(intToString.transform(k[0])));
         assertEquals(--sz, map.size());
 
-        TransformedMap<String, String, String, Integer> map2 = TransformedMap.transformingMap(
+        final TransformedMap<String, String, String, Integer> map2 = TransformedMap.transformingMap(
                 new HashMap<String, Integer>(), NOPTransformer.<String> nopTransformer(), stringToInt);
         assertEquals(0, map2.size());
         for (int i = 0; i < 6; i++) {
@@ -104,37 +104,37 @@ public class TransformedMapTest extends 
     // -----------------------------------------------------------------------
 
     public void testMapIterator() {
-        TransformedMap<String, String, String, Integer> map = TransformedMap.transformingMap(
+        final TransformedMap<String, String, String, Integer> map = TransformedMap.transformingMap(
                 new HashMap<String, Integer>(), NOPTransformer.<String> nopTransformer(), stringToInt);
         assertEquals(0, map.size());
         for (int i = 0; i < 6; i++) {
             map.put(String.valueOf(i), String.valueOf(i));
         }
 
-        for (MapIterator<String, Integer> it = map.mapIterator(); it.hasNext();) {
-            String k = it.next();
+        for (final MapIterator<String, Integer> it = map.mapIterator(); it.hasNext();) {
+            final String k = it.next();
             assertEquals(k, it.getKey());
             assertEquals(map.get(k), it.getValue());
         }
     }
 
     public void testEmptyMap() throws IOException, ClassNotFoundException {
-        TransformedMap<String, String, String, String> map = TransformedMap.transformingMap(
+        final TransformedMap<String, String, String, String> map = TransformedMap.transformingMap(
                 new HashMap<String, String>(),
                 NOPTransformer.<String>nopTransformer(),
                 NOPTransformer.<String>nopTransformer() );
 
-        ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"/TransformedMap.emptyCollection.version3.2.obj" ) );
-        Object readObject = in.readObject();
+        final ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"/TransformedMap.emptyCollection.version3.2.obj" ) );
+        final Object readObject = in.readObject();
         in.close();
 
-        TransformedMap<?, ?, ?, ?> readMap = (TransformedMap<?, ?, ?, ?>) readObject;
+        final TransformedMap<?, ?, ?, ?> readMap = (TransformedMap<?, ?, ?, ?>) readObject;
         assertTrue( "Map should be empty", readMap.size() == 0 );
         assertEquals( map.entrySet(), readMap.entrySet() );
     }
 
     public void testFullMap() throws IOException, ClassNotFoundException {
-        TransformedMap<String, String, String, String> map = TransformedMap.transformingMap(
+        final TransformedMap<String, String, String, String> map = TransformedMap.transformingMap(
                 new HashMap<String, String>(),
                 NOPTransformer.<String>nopTransformer(),
                 NOPTransformer.<String>nopTransformer() );
@@ -143,11 +143,11 @@ public class TransformedMapTest extends 
         map.put( "e", "f" );
         map.put( "g", "h" );
 
-        ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"TransformedMap.fullCollection.version3.2.obj" ) );
-        Object readObject = in.readObject();
+        final ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"TransformedMap.fullCollection.version3.2.obj" ) );
+        final Object readObject = in.readObject();
         in.close();
 
-        TransformedMap<?, ?, ?, ?> readMap = (TransformedMap<?, ?, ?, ?>) readObject;
+        final TransformedMap<?, ?, ?, ?> readMap = (TransformedMap<?, ?, ?, ?>) readObject;
         assertFalse( "Map should not be empty", readMap.size() == 0 );
         assertEquals( map.entrySet(), readMap.entrySet() );
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzerTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzerTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzerTest.java Mon Jan  7 17:15:14 2013
@@ -29,9 +29,9 @@ public class ByteArrayKeyAnalyzerTest {
     
     @Test
     public void bitSet() {
-        byte[] key = toByteArray("10100110", 2);
-        ByteArrayKeyAnalyzer ka = new ByteArrayKeyAnalyzer(key.length * 8);
-        int length = ka.lengthInBits(key);
+        final byte[] key = toByteArray("10100110", 2);
+        final ByteArrayKeyAnalyzer ka = new ByteArrayKeyAnalyzer(key.length * 8);
+        final int length = ka.lengthInBits(key);
         
         Assert.assertTrue(ka.isBitSet(key, 0, length));
         Assert.assertFalse(ka.isBitSet(key, 1, length));
@@ -45,17 +45,17 @@ public class ByteArrayKeyAnalyzerTest {
     
     @Test
     public void keys() {
-        PatriciaTrie<byte[], BigInteger> trie
+        final PatriciaTrie<byte[], BigInteger> trie
             = new PatriciaTrie<byte[], BigInteger>(ByteArrayKeyAnalyzer.INSTANCE);
         
-        Map<byte[], BigInteger> map 
+        final Map<byte[], BigInteger> map 
             = new TreeMap<byte[], BigInteger>(ByteArrayKeyAnalyzer.INSTANCE);
         
         for (int i = 0; i < SIZE; i++) {
-            BigInteger value = BigInteger.valueOf(i);
-            byte[] key = toByteArray(value);
+            final BigInteger value = BigInteger.valueOf(i);
+            final byte[] key = toByteArray(value);
             
-            BigInteger existing = trie.put(key, value);
+            final BigInteger existing = trie.put(key, value);
             Assert.assertNull(existing);
             
             map.put(key, value);
@@ -63,9 +63,9 @@ public class ByteArrayKeyAnalyzerTest {
         
         Assert.assertEquals(map.size(), trie.size());
         
-        for (byte[] key : map.keySet()) {
-            BigInteger expected = new BigInteger(1, key);
-            BigInteger value = trie.get(key);
+        for (final byte[] key : map.keySet()) {
+            final BigInteger expected = new BigInteger(1, key);
+            final BigInteger value = trie.get(key);
             
             Assert.assertEquals(expected, value);
         }
@@ -73,28 +73,28 @@ public class ByteArrayKeyAnalyzerTest {
     
     @Test
     public void prefix() {
-        byte[] prefix   = toByteArray("00001010", 2);
-        byte[] key1     = toByteArray("11001010", 2);
-        byte[] key2     = toByteArray("10101100", 2);
+        final byte[] prefix   = toByteArray("00001010", 2);
+        final byte[] key1     = toByteArray("11001010", 2);
+        final byte[] key2     = toByteArray("10101100", 2);
         
-        ByteArrayKeyAnalyzer keyAnalyzer = new ByteArrayKeyAnalyzer(key1.length * 8);
+        final ByteArrayKeyAnalyzer keyAnalyzer = new ByteArrayKeyAnalyzer(key1.length * 8);
         
-        int prefixLength = keyAnalyzer.lengthInBits(prefix);
+        final int prefixLength = keyAnalyzer.lengthInBits(prefix);
             
         Assert.assertFalse(keyAnalyzer.isPrefix(prefix, 4, prefixLength, key1));
         Assert.assertTrue(keyAnalyzer.isPrefix(prefix, 4, prefixLength, key2));
     }
     
-    private static byte[] toByteArray(String value, int radix) {
+    private static byte[] toByteArray(final String value, final int radix) {
         return toByteArray(Long.parseLong(value, radix));
     }
     
-    private static byte[] toByteArray(long value) {
+    private static byte[] toByteArray(final long value) {
         return toByteArray(BigInteger.valueOf(value));
     }
     
-    private static byte[] toByteArray(BigInteger value) {
-        byte[] src = value.toByteArray();
+    private static byte[] toByteArray(final BigInteger value) {
+        final byte[] src = value.toByteArray();
         if (src.length <= 1) {
             return src;
         }
@@ -103,7 +103,7 @@ public class ByteArrayKeyAnalyzerTest {
             return src;
         }
         
-        byte[] dst = new byte[src.length-1];
+        final byte[] dst = new byte[src.length-1];
         System.arraycopy(src, 1, dst, 0, dst.length);
         return dst;
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/PatriciaTrieTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/PatriciaTrieTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/PatriciaTrieTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/trie/PatriciaTrieTest.java Mon Jan  7 17:15:14 2013
@@ -42,7 +42,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testSimple() {
-        PatriciaTrie<Integer, String> intTrie = new PatriciaTrie<Integer, String>(new IntegerKeyAnalyzer());
+        final PatriciaTrie<Integer, String> intTrie = new PatriciaTrie<Integer, String>(new IntegerKeyAnalyzer());
         Assert.assertTrue(intTrie.isEmpty());
         Assert.assertEquals(0, intTrie.size());
         
@@ -66,7 +66,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testCeilingEntry() {
-        PatriciaTrie<Character, String> charTrie 
+        final PatriciaTrie<Character, String> charTrie 
             = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
@@ -95,7 +95,7 @@ public class PatriciaTrieTest {
         charTrie.put('f', "f");
         charTrie.put('d', "d");
         
-        Object[] results = new Object[] {
+        final Object[] results = new Object[] {
             'a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
             'f', "f", 'g', "g", 'h', "h", 'i', "i", 'j', "j",
             'k', "k", 'l', "l", 'm', "m", 'n', "n", 'o', "o",
@@ -105,7 +105,7 @@ public class PatriciaTrieTest {
         };
         
         for(int i = 0; i < results.length; i++) {
-            Map.Entry<Character, String> found = charTrie.ceilingEntry((Character)results[i]);
+            final Map.Entry<Character, String> found = charTrie.ceilingEntry((Character)results[i]);
             Assert.assertNotNull(found);
             Assert.assertEquals(results[i], found.getKey());
             Assert.assertEquals(results[++i], found.getValue());
@@ -159,7 +159,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testLowerEntry() {
-        PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
+        final PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
         charTrie.put('l', "l");
@@ -187,7 +187,7 @@ public class PatriciaTrieTest {
         charTrie.put('f', "f");
         charTrie.put('d', "d");
         
-        Object[] results = new Object[] {
+        final Object[] results = new Object[] {
             'a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
             'f', "f", 'g', "g", 'h', "h", 'i', "i", 'j', "j",
             'k', "k", 'l', "l", 'm', "m", 'n', "n", 'o', "o",
@@ -198,7 +198,7 @@ public class PatriciaTrieTest {
         
         for(int i = 0; i < results.length; i+=2) {
             //System.out.println("Looking for: " + results[i]);
-            Map.Entry<Character, String> found = charTrie.lowerEntry((Character)results[i]);
+            final Map.Entry<Character, String> found = charTrie.lowerEntry((Character)results[i]);
             if(i == 0) {
                 Assert.assertNull(found);
             } else {
@@ -270,7 +270,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testIteration() {
-        PatriciaTrie<Integer, String> intTrie = new PatriciaTrie<Integer, String>(new IntegerKeyAnalyzer());
+        final PatriciaTrie<Integer, String> intTrie = new PatriciaTrie<Integer, String>(new IntegerKeyAnalyzer());
         intTrie.put(1, "One");
         intTrie.put(5, "Five");
         intTrie.put(4, "Four");
@@ -290,24 +290,24 @@ public class PatriciaTrieTest {
         cursor.finished();
         
         cursor.starting();
-        for (Map.Entry<Integer, String> entry : intTrie.entrySet()) {
+        for (final Map.Entry<Integer, String> entry : intTrie.entrySet()) {
             cursor.select(entry);
         }
         cursor.finished();
         
         cursor.starting();
-        for (Integer integer : intTrie.keySet()) {
+        for (final Integer integer : intTrie.keySet()) {
             cursor.checkKey(integer);
         }
         cursor.finished();
         
         cursor.starting();
-        for (String string : intTrie.values()) {
+        for (final String string : intTrie.values()) {
             cursor.checkValue(string);
         }
         cursor.finished();
 
-        PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
+        final PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
         charTrie.put('l', "l");
@@ -346,19 +346,19 @@ public class PatriciaTrieTest {
         cursor.finished();
 
         cursor.starting();
-        for (Map.Entry<Character, String> entry : charTrie.entrySet()) {
+        for (final Map.Entry<Character, String> entry : charTrie.entrySet()) {
             cursor.select(entry);
         }
         cursor.finished();
         
         cursor.starting();
-        for (Character character : charTrie.keySet()) {
+        for (final Character character : charTrie.keySet()) {
             cursor.checkKey(character);
         }
         cursor.finished();
         
         cursor.starting();
-        for (String string : charTrie.values()) {
+        for (final String string : charTrie.values()) {
             cursor.checkValue(string);
         }
         cursor.finished();
@@ -366,7 +366,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testSelect() {
-        PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
+        final PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
         charTrie.put('l', "l");
@@ -393,7 +393,7 @@ public class PatriciaTrieTest {
         charTrie.put('z', "z");
         charTrie.put('f', "f");
         charTrie.put('d', "d");
-        TestCursor cursor = new TestCursor(
+        final TestCursor cursor = new TestCursor(
                 'd', "d", 'e', "e", 'f', "f", 'g', "g",
                 'a', "a", 'b', "b", 'c', "c",  
                 'l', "l", 'm', "m", 'n', "n", 'o', "o",
@@ -411,7 +411,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testTraverseCursorRemove() {
-        PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
+        final PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
         charTrie.put('l', "l");
@@ -438,7 +438,7 @@ public class PatriciaTrieTest {
         charTrie.put('z', "z");
         charTrie.put('f', "f");
         charTrie.put('d', "d");
-        TestCursor cursor = new TestCursor('a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
+        final TestCursor cursor = new TestCursor('a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
                 'f', "f", 'g', "g", 'h', "h", 'i', "i", 'j', "j",
                 'k', "k", 'l', "l", 'm', "m", 'n', "n", 'o', "o",
                 'p', "p", 'q', "q", 'r', "r", 's', "s", 't', "t",
@@ -454,7 +454,7 @@ public class PatriciaTrieTest {
         
         Assert.assertEquals(26, charTrie.size());
         
-        Object[] toRemove = new Object[] { 'g', 'd', 'e', 'm', 'p', 'q', 'r', 's' };
+        final Object[] toRemove = new Object[] { 'g', 'd', 'e', 'm', 'p', 'q', 'r', 's' };
         cursor.addToRemove(toRemove);
         
         cursor.starting();
@@ -468,7 +468,7 @@ public class PatriciaTrieTest {
         cursor.finished();
         
         cursor.starting();
-        for (Entry<Character, String> entry : charTrie.entrySet()) {
+        for (final Entry<Character, String> entry : charTrie.entrySet()) {
             cursor.select(entry);
             if (Arrays.asList(toRemove).contains(entry.getKey())) {
                 Assert.fail("got an: " + entry);
@@ -479,7 +479,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testIteratorRemove() {
-        PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
+        final PatriciaTrie<Character, String> charTrie = new PatriciaTrie<Character, String>(new CharacterKeyAnalyzer());
         charTrie.put('c', "c");
         charTrie.put('p', "p");
         charTrie.put('l', "l");
@@ -506,7 +506,7 @@ public class PatriciaTrieTest {
         charTrie.put('z', "z");
         charTrie.put('f', "f");
         charTrie.put('d', "d");
-        TestCursor cursor = new TestCursor('a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
+        final TestCursor cursor = new TestCursor('a', "a", 'b', "b", 'c', "c", 'd', "d", 'e', "e",
                 'f', "f", 'g', "g", 'h', "h", 'i', "i", 'j', "j",
                 'k', "k", 'l', "l", 'm', "m", 'n', "n", 'o', "o",
                 'p', "p", 'q', "q", 'r', "r", 's', "s", 't', "t",
@@ -518,11 +518,11 @@ public class PatriciaTrieTest {
         
         Assert.assertEquals(26, charTrie.size());
         
-        Object[] toRemove = new Object[] { 'e', 'm', 'p', 'q', 'r', 's' };
+        final Object[] toRemove = new Object[] { 'e', 'm', 'p', 'q', 'r', 's' };
         
         cursor.starting();
-        for(Iterator<Map.Entry<Character, String>> i = charTrie.entrySet().iterator(); i.hasNext(); ) {
-            Map.Entry<Character,String> entry = i.next();
+        for(final Iterator<Map.Entry<Character, String>> i = charTrie.entrySet().iterator(); i.hasNext(); ) {
+            final Map.Entry<Character,String> entry = i.next();
             cursor.select(entry);
             if(Arrays.asList(toRemove).contains(entry.getKey())) {
                 i.remove();            
@@ -535,7 +535,7 @@ public class PatriciaTrieTest {
         cursor.remove(toRemove);
 
         cursor.starting();
-        for (Entry<Character, String> entry : charTrie.entrySet()) {
+        for (final Entry<Character, String> entry : charTrie.entrySet()) {
             cursor.select(entry);
             if (Arrays.asList(toRemove).contains(entry.getKey())) {
                 Assert.fail("got an: " + entry);
@@ -547,19 +547,19 @@ public class PatriciaTrieTest {
     @Test
     public void testHamlet() throws Exception {
         // Make sure that Hamlet is read & stored in the same order as a SortedSet.
-        List<String> original = new ArrayList<String>();
-        List<String> control = new ArrayList<String>();
-        SortedMap<String, String> sortedControl = new TreeMap<String, String>();
-        PatriciaTrie<String, String> trie = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
+        final List<String> original = new ArrayList<String>();
+        final List<String> control = new ArrayList<String>();
+        final SortedMap<String, String> sortedControl = new TreeMap<String, String>();
+        final PatriciaTrie<String, String> trie = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
-        InputStream in = getClass().getResourceAsStream("hamlet.txt");
-        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+        final InputStream in = getClass().getResourceAsStream("hamlet.txt");
+        final BufferedReader reader = new BufferedReader(new InputStreamReader(in));
         
         String read = null;
         while( (read = reader.readLine()) != null) {
-            StringTokenizer st = new StringTokenizer(read);
+            final StringTokenizer st = new StringTokenizer(read);
             while(st.hasMoreTokens()) {
-                String token = st.nextToken();
+                final String token = st.nextToken();
                 original.add(token);
                 sortedControl.put(token, token);
                 trie.put(token, token);
@@ -570,11 +570,11 @@ public class PatriciaTrieTest {
         Assert.assertEquals(control.size(), sortedControl.size());
         Assert.assertEquals(sortedControl.size(), trie.size());
         Iterator<String> iter = trie.values().iterator();
-        for (String aControl : control) {
+        for (final String aControl : control) {
             Assert.assertEquals(aControl, iter.next());
         }
         
-        Random rnd = new Random();
+        final Random rnd = new Random();
         int item = 0;
         iter = trie.values().iterator();
         int removed = 0;
@@ -592,7 +592,7 @@ public class PatriciaTrieTest {
         
         // reset hamlet
         trie.clear();
-        for (String anOriginal : original) {
+        for (final String anOriginal : original) {
             trie.put(anOriginal, anOriginal);
         }
         
@@ -620,7 +620,7 @@ public class PatriciaTrieTest {
         try {
             sub.headMap(control.get(524));
             Assert.fail("should have thrown IAE");
-        } catch(IllegalArgumentException expected) {}
+        } catch(final IllegalArgumentException expected) {}
         
         Assert.assertEquals(sub.lastKey(), control.get(522));
         Assert.assertEquals(sub.firstKey(), control.get(0));
@@ -640,7 +640,7 @@ public class PatriciaTrieTest {
         try {
             sub.tailMap(control.get(232));
             Assert.fail("should have thrown IAE");
-        } catch(IllegalArgumentException expected) {}
+        } catch(final IllegalArgumentException expected) {}
         
         sub = sub.subMap(control.get(300), control.get(400));
         Assert.assertEquals(100, sub.size());
@@ -658,7 +658,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testPrefixedBy() {
-        PatriciaTrie<String, String> trie 
+        final PatriciaTrie<String, String> trie 
             = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
         final String[] keys = new String[]{
@@ -669,7 +669,7 @@ public class PatriciaTrieTest {
                 "Amma"
         };
 
-        for (String key : keys) {
+        for (final String key : keys) {
             trie.put(key, key);
         }
         
@@ -804,7 +804,7 @@ public class PatriciaTrieTest {
         try {
             iterator.next();
             Assert.fail("CME expected");
-        } catch(ConcurrentModificationException expected) {}
+        } catch(final ConcurrentModificationException expected) {}
         Assert.assertEquals("Amber", map.firstKey());
         Assert.assertEquals("Ammun", map.lastKey());
         
@@ -843,13 +843,13 @@ public class PatriciaTrieTest {
         Assert.assertTrue(map.isEmpty());
         Assert.assertEquals(0, map.size());
         try {
-            Object o = map.firstKey();
+            final Object o = map.firstKey();
             Assert.fail("got a first key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         try {
-            Object o = map.lastKey();
+            final Object o = map.lastKey();
             Assert.fail("got a last key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         iterator = map.values().iterator();
         Assert.assertFalse(iterator.hasNext());
         
@@ -857,13 +857,13 @@ public class PatriciaTrieTest {
         Assert.assertTrue(map.isEmpty());
         Assert.assertEquals(0, map.size());
         try {
-            Object o = map.firstKey();
+            final Object o = map.firstKey();
             Assert.fail("got a first key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         try {
-            Object o = map.lastKey();
+            final Object o = map.lastKey();
             Assert.fail("got a last key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         iterator = map.values().iterator();
         Assert.assertFalse(iterator.hasNext());
         
@@ -874,20 +874,20 @@ public class PatriciaTrieTest {
         Assert.assertTrue(map.isEmpty());
         Assert.assertEquals(0, map.size());
         try {
-            Object o = map.firstKey();
+            final Object o = map.firstKey();
             Assert.fail("got a first key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         try {
-            Object o = map.lastKey();
+            final Object o = map.lastKey();
             Assert.fail("got a last key: " + o);
-        } catch(NoSuchElementException nsee) {}
+        } catch(final NoSuchElementException nsee) {}
         iterator = map.values().iterator();
         Assert.assertFalse(iterator.hasNext());
     }
     
     @Test
     public void testPrefixByOffsetAndLength() {
-        PatriciaTrie<String, String> trie 
+        final PatriciaTrie<String, String> trie 
             = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
         final String[] keys = new String[]{
@@ -897,7 +897,7 @@ public class PatriciaTrieTest {
                 "Amma"
         };
     
-        for (String key : keys) {
+        for (final String key : keys) {
             trie.put(key, key);
         }
         
@@ -947,7 +947,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testPrefixedByRemoval() {
-        PatriciaTrie<String, String> trie 
+        final PatriciaTrie<String, String> trie 
             = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
         final String[] keys = new String[]{
@@ -957,7 +957,7 @@ public class PatriciaTrieTest {
                 "Amma"
         };
 
-        for (String key : keys) {
+        for (final String key : keys) {
             trie.put(key, key);
         }
         
@@ -991,7 +991,7 @@ public class PatriciaTrieTest {
 
     @Test
     public void testTraverseWithAllNullBitKey() {
-        PatriciaTrie<String, String> trie 
+        final PatriciaTrie<String, String> trie 
             = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
         //
@@ -1010,7 +1010,7 @@ public class PatriciaTrieTest {
         
         final List<String> strings = new ArrayList<String>();
         trie.traverse(new Cursor<String, String>() {
-            public Decision select(Entry<? extends String, ? extends String> entry) {
+            public Decision select(final Entry<? extends String, ? extends String> entry) {
                 strings.add(entry.getValue());
                 return Decision.CONTINUE;
             }
@@ -1019,7 +1019,7 @@ public class PatriciaTrieTest {
         Assert.assertEquals(1, strings.size());
         
         strings.clear();
-        for (String s : trie.values()) {
+        for (final String s : trie.values()) {
             strings.add(s);
         }
         Assert.assertEquals(1, strings.size());
@@ -1027,7 +1027,7 @@ public class PatriciaTrieTest {
     
     @Test
     public void testSelectWithAllNullBitKey() {
-        PatriciaTrie<String, String> trie 
+        final PatriciaTrie<String, String> trie 
             = new PatriciaTrie<String, String>(new StringKeyAnalyzer());
         
         // trie.put("", "All Bits Are Zero");
@@ -1035,7 +1035,7 @@ public class PatriciaTrieTest {
         
         final List<String> strings = new ArrayList<String>();
         trie.select("Hello", new Cursor<String, String>() {
-            public Decision select(Entry<? extends String, ? extends String> entry) {
+            public Decision select(final Entry<? extends String, ? extends String> entry) {
                 strings.add(entry.getValue());
                 return Decision.CONTINUE;
             }
@@ -1044,13 +1044,13 @@ public class PatriciaTrieTest {
     }
     
     private static class TestCursor implements Cursor<Object, Object> {
-        private List<Object> keys;
-        private List<Object> values;
+        private final List<Object> keys;
+        private final List<Object> values;
         private Object selectFor;
         private List<Object> toRemove;
         private int index = 0;
         
-        TestCursor(Object... objects) {
+        TestCursor(final Object... objects) {
             if(objects.length % 2 != 0) {
                 throw new IllegalArgumentException("must be * 2");
             }
@@ -1064,17 +1064,17 @@ public class PatriciaTrieTest {
             }
         }
         
-        void selectFor(Object object) {
+        void selectFor(final Object object) {
             selectFor = object;
         }
         
-        void addToRemove(Object... objects) {
+        void addToRemove(final Object... objects) {
             toRemove = new ArrayList<Object>(Arrays.asList(objects));
         }
         
-        void remove(Object... objects) {
-            for (Object object : objects) {
-                int idx = keys.indexOf(object);
+        void remove(final Object... objects) {
+            for (final Object object : objects) {
+                final int idx = keys.indexOf(object);
                 keys.remove(idx);
                 values.remove(idx);
             }
@@ -1084,15 +1084,15 @@ public class PatriciaTrieTest {
             index = 0;
         }
         
-        public void checkKey(Object k) {
+        public void checkKey(final Object k) {
             Assert.assertEquals(keys.get(index++), k);
         }
         
-        public void checkValue(Object o) {
+        public void checkValue(final Object o) {
             Assert.assertEquals(values.get(index++), o);
         }
 
-        public Decision select(Entry<?, ?> entry) {
+        public Decision select(final Entry<?, ?> entry) {
           //  System.out.println("Scanning: " + entry.getKey());
             Assert.assertEquals(keys.get(index), entry.getKey());
             Assert.assertEquals(values.get(index), entry.getValue());
@@ -1119,7 +1119,7 @@ public class PatriciaTrieTest {
         }
     }
     
-    private static void assertEqualArrays(Object[] a, Object[] b) {
+    private static void assertEqualArrays(final Object[] a, final Object[] b) {
         Assert.assertTrue(Arrays.equals(a, b));
     }
 }