commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1429905 [22/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/...
Date Mon, 07 Jan 2013 17:15:24 GMT
Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/MultiKeyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/MultiKeyTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/MultiKeyTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/MultiKeyTest.java Mon Jan  7 17:15:14 2013
@@ -42,7 +42,7 @@ public class MultiKeyTest extends TestCa
     Integer FOUR = new Integer(4);
     Integer FIVE = new Integer(5);
 
-    public MultiKeyTest(String name) {
+    public MultiKeyTest(final String name) {
         super(name);
     }
 
@@ -103,19 +103,19 @@ public class MultiKeyTest extends TestCa
     }
 
     public void testConstructorsByArrayNull() throws Exception {
-        Integer[] keys = null;
+        final Integer[] keys = null;
         try {
             new MultiKey<Integer>(keys);
             fail();
-        } catch (IllegalArgumentException ex) {}
+        } catch (final IllegalArgumentException ex) {}
         try {
             new MultiKey<Integer>(keys, true);
             fail();
-        } catch (IllegalArgumentException ex) {}
+        } catch (final IllegalArgumentException ex) {}
         try {
             new MultiKey<Integer>(keys, false);
             fail();
-        } catch (IllegalArgumentException ex) {}
+        } catch (final IllegalArgumentException ex) {}
     }
 
     public void testSize() {
@@ -135,31 +135,31 @@ public class MultiKeyTest extends TestCa
     }
 
     public void testGetIndexed() {
-        MultiKey<Integer> mk = new MultiKey<Integer>(ONE, TWO);
+        final MultiKey<Integer> mk = new MultiKey<Integer>(ONE, TWO);
         Assert.assertSame(ONE, mk.getKey(0));
         Assert.assertSame(TWO, mk.getKey(1));
         try {
             mk.getKey(-1);
             fail();
-        } catch (IndexOutOfBoundsException ex) {}
+        } catch (final IndexOutOfBoundsException ex) {}
         try {
             mk.getKey(2);
             fail();
-        } catch (IndexOutOfBoundsException ex) {}
+        } catch (final IndexOutOfBoundsException ex) {}
     }
 
     public void testGetKeysSimpleConstructor() {
-        MultiKey<Integer> mk = new MultiKey<Integer>(ONE, TWO);
-        Object[] array = mk.getKeys();
+        final MultiKey<Integer> mk = new MultiKey<Integer>(ONE, TWO);
+        final Object[] array = mk.getKeys();
         Assert.assertSame(ONE, array[0]);
         Assert.assertSame(TWO, array[1]);
         Assert.assertEquals(2, array.length);
     }
 
     public void testGetKeysArrayConstructorCloned() {
-        Integer[] keys = new Integer[] { ONE, TWO };
-        MultiKey<Integer> mk = new MultiKey<Integer>(keys, true);
-        Object[] array = mk.getKeys();
+        final Integer[] keys = new Integer[] { ONE, TWO };
+        final MultiKey<Integer> mk = new MultiKey<Integer>(keys, true);
+        final Object[] array = mk.getKeys();
         Assert.assertTrue(array != keys);
         Assert.assertTrue(Arrays.equals(array, keys));
         Assert.assertSame(ONE, array[0]);
@@ -168,9 +168,9 @@ public class MultiKeyTest extends TestCa
     }
 
     public void testGetKeysArrayConstructorNonCloned() {
-        Integer[] keys = new Integer[] { ONE, TWO };
-        MultiKey<Integer> mk = new MultiKey<Integer>(keys, false);
-        Object[] array = mk.getKeys();
+        final Integer[] keys = new Integer[] { ONE, TWO };
+        final MultiKey<Integer> mk = new MultiKey<Integer>(keys, false);
+        final Object[] array = mk.getKeys();
         Assert.assertTrue(array != keys);  // still not equal
         Assert.assertTrue(Arrays.equals(array, keys));
         Assert.assertSame(ONE, array[0]);
@@ -179,22 +179,22 @@ public class MultiKeyTest extends TestCa
     }
 
     public void testHashCode() {
-        MultiKey<Integer> mk1 = new MultiKey<Integer>(ONE, TWO);
-        MultiKey<Integer> mk2 = new MultiKey<Integer>(ONE, TWO);
-        MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
+        final MultiKey<Integer> mk1 = new MultiKey<Integer>(ONE, TWO);
+        final MultiKey<Integer> mk2 = new MultiKey<Integer>(ONE, TWO);
+        final MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
 
         Assert.assertTrue(mk1.hashCode() == mk1.hashCode());
         Assert.assertTrue(mk1.hashCode() == mk2.hashCode());
         Assert.assertTrue(mk1.hashCode() != mk3.hashCode());
 
-        int total = (0 ^ ONE.hashCode()) ^ TWO.hashCode();
+        final int total = (0 ^ ONE.hashCode()) ^ TWO.hashCode();
         Assert.assertEquals(total, mk1.hashCode());
     }
 
     public void testEquals() {
-        MultiKey<Integer> mk1 = new MultiKey<Integer>(ONE, TWO);
-        MultiKey<Integer> mk2 = new MultiKey<Integer>(ONE, TWO);
-        MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
+        final MultiKey<Integer> mk1 = new MultiKey<Integer>(ONE, TWO);
+        final MultiKey<Integer> mk2 = new MultiKey<Integer>(ONE, TWO);
+        final MultiKey<Object> mk3 = new MultiKey<Object>(ONE, "TWO");
 
         Assert.assertEquals(mk1, mk1);
         Assert.assertEquals(mk1, mk2);
@@ -209,13 +209,13 @@ public class MultiKeyTest extends TestCa
         private final String name;
         private int hashCode = 1;
 
-        public SystemHashCodeSimulatingKey(String name)
+        public SystemHashCodeSimulatingKey(final String name)
         {
             this.name = name;
         }
 
         @Override
-        public boolean equals(Object obj)
+        public boolean equals(final Object obj)
         {
             return obj instanceof SystemHashCodeSimulatingKey 
                 && name.equals(((SystemHashCodeSimulatingKey)obj).name);
@@ -236,27 +236,27 @@ public class MultiKeyTest extends TestCa
     public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException
     {
         SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test");
-        MultiKey mk = new MultiKey(ONE, sysKey);
-        Map map = new HashMap();
+        final MultiKey mk = new MultiKey(ONE, sysKey);
+        final Map map = new HashMap();
         map.put(mk, TWO);
 
         // serialize
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ObjectOutputStream out = new ObjectOutputStream(baos);
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final ObjectOutputStream out = new ObjectOutputStream(baos);
         out.writeObject(sysKey);
         out.writeObject(map);
         out.close();
 
         // deserialize
-        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(bais);
+        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+        final ObjectInputStream in = new ObjectInputStream(bais);
         sysKey = (SystemHashCodeSimulatingKey)in.readObject(); // simulate deserialization in another process
-        Map map2 = (Map) in.readObject();
+        final Map map2 = (Map) in.readObject();
         in.close();
 
         assertEquals(2, sysKey.hashCode()); // different hashCode now
 
-        MultiKey mk2 = new MultiKey(ONE, sysKey);
+        final MultiKey mk2 = new MultiKey(ONE, sysKey);
         assertEquals(TWO, map2.get(mk2));        
     }
 }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/TiedMapEntryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/TiedMapEntryTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/TiedMapEntryTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/TiedMapEntryTest.java Mon Jan  7 17:15:14 2013
@@ -27,7 +27,7 @@ import java.util.Map;
  */
 public class TiedMapEntryTest<K, V> extends AbstractMapEntryTest<K, V> {
 
-    public TiedMapEntryTest(String testName) {
+    public TiedMapEntryTest(final String testName) {
         super(testName);
     }
 
@@ -36,8 +36,8 @@ public class TiedMapEntryTest<K, V> exte
      * Gets the instance to test
      */
     @Override
-    public Map.Entry<K, V> makeMapEntry(K key, V value) {
-        Map<K, V> map = new HashMap<K, V>();
+    public Map.Entry<K, V> makeMapEntry(final K key, final V value) {
+        final Map<K, V> map = new HashMap<K, V>();
         map.put(key, value);
         return new TiedMapEntry<K, V>(map, key);
     }
@@ -56,7 +56,7 @@ public class TiedMapEntryTest<K, V> exte
      */
     @SuppressWarnings("unchecked")
     public void testSetValue() {
-        Map<K, V> map = new HashMap<K, V>();
+        final Map<K, V> map = new HashMap<K, V>();
         map.put((K) "A", (V) "a");
         map.put((K) "B", (V) "b");
         map.put((K) "C", (V) "c");

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/UnmodifiableMapEntryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/UnmodifiableMapEntryTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/UnmodifiableMapEntryTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/keyvalue/UnmodifiableMapEntryTest.java Mon Jan  7 17:15:14 2013
@@ -29,7 +29,7 @@ import org.apache.commons.collections.Un
  */
 public class UnmodifiableMapEntryTest<K, V> extends AbstractMapEntryTest<K, V> {
 
-    public UnmodifiableMapEntryTest(String testName) {
+    public UnmodifiableMapEntryTest(final String testName) {
         super(testName);
     }
 
@@ -50,7 +50,7 @@ public class UnmodifiableMapEntryTest<K,
      * of the type being tested.
      */
     @Override
-    public Map.Entry<K, V> makeMapEntry(K key, V value) {
+    public Map.Entry<K, V> makeMapEntry(final K key, final V value) {
         return new UnmodifiableMapEntry<K, V>(key, value);
     }
 
@@ -68,13 +68,13 @@ public class UnmodifiableMapEntryTest<K,
         assertSame(value, entry.getValue());
 
         // 2. test pair constructor
-        KeyValue<K, V> pair = new DefaultKeyValue<K, V>((K) key, (V) value);
+        final KeyValue<K, V> pair = new DefaultKeyValue<K, V>((K) key, (V) value);
         entry = new UnmodifiableMapEntry<K, V>(pair);
         assertSame(key, entry.getKey());
         assertSame(value, entry.getValue());
 
         // 3. test copy constructor
-        Map.Entry<K, V> entry2 = new UnmodifiableMapEntry<K, V>(entry);
+        final Map.Entry<K, V> entry2 = new UnmodifiableMapEntry<K, V>(entry);
         assertSame(key, entry2.getKey());
         assertSame(value, entry2.getValue());
 
@@ -101,11 +101,11 @@ public class UnmodifiableMapEntryTest<K,
     }
 
     public void testUnmodifiable() {
-        Map.Entry<K, V> entry = makeMapEntry();
+        final Map.Entry<K, V> entry = makeMapEntry();
         try {
             entry.setValue(null);
             fail();
-        } catch (UnsupportedOperationException ex) {}
+        } catch (final UnsupportedOperationException ex) {}
     }
 
 }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractLinkedListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractLinkedListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractLinkedListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractLinkedListTest.java Mon Jan  7 17:15:14 2013
@@ -29,7 +29,7 @@ import java.util.Arrays;
  */
 public abstract class AbstractLinkedListTest<E> extends AbstractListTest<E> {
 
-    public AbstractLinkedListTest(String testName) {
+    public AbstractLinkedListTest(final String testName) {
         super(testName);
     }
 
@@ -37,11 +37,11 @@ public abstract class AbstractLinkedList
     @SuppressWarnings("unchecked")
     public void testRemoveFirst() {
         resetEmpty();
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
         if (isRemoveSupported() == false) {
             try {
                 list.removeFirst();
-            } catch (UnsupportedOperationException ex) {}
+            } catch (final UnsupportedOperationException ex) {}
         }
 
         list.addAll(Arrays.asList((E[]) new String[] { "value1", "value2" }));
@@ -61,11 +61,11 @@ public abstract class AbstractLinkedList
     @SuppressWarnings("unchecked")
     public void testRemoveLast() {
         resetEmpty();
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
         if (isRemoveSupported() == false) {
             try {
                 list.removeLast();
-            } catch (UnsupportedOperationException ex) {}
+            } catch (final UnsupportedOperationException ex) {}
         }
 
         list.addAll(Arrays.asList((E[]) new String[] { "value1", "value2" }));
@@ -82,11 +82,11 @@ public abstract class AbstractLinkedList
     @SuppressWarnings("unchecked")
     public void testAddNodeAfter() {
         resetEmpty();
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
         if (isAddSupported() == false) {
             try {
                 list.addFirst(null);
-            } catch (UnsupportedOperationException ex) {}
+            } catch (final UnsupportedOperationException ex) {}
         }
 
         list.addFirst((E) "value1");
@@ -118,7 +118,7 @@ public abstract class AbstractLinkedList
         if (isAddSupported() == false || isRemoveSupported() == false) {
             return;
         }
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
 
         list.addAll(Arrays.asList((E[]) new String[] { "value1", "value2" }));
         list.removeNode(list.getNode(0, false));
@@ -141,13 +141,13 @@ public abstract class AbstractLinkedList
     @SuppressWarnings("unchecked")
     public void testGetNode() {
         resetEmpty();
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
         // get marker
         assertEquals(list.getNode(0, true).previous, list.getNode(0, true).next);
         try {
             list.getNode(0, false);
             fail("Expecting IndexOutOfBoundsException.");
-        } catch (IndexOutOfBoundsException ex) {
+        } catch (final IndexOutOfBoundsException ex) {
             // expected
         }
         list.addAll( Arrays.asList((E[]) new String[]{"value1", "value2"}));
@@ -159,25 +159,25 @@ public abstract class AbstractLinkedList
         try {
             list.getNode(2, false);
             fail("Expecting IndexOutOfBoundsException.");
-        } catch (IndexOutOfBoundsException ex) {
+        } catch (final IndexOutOfBoundsException ex) {
             // expected
         }
         try {
             list.getNode(-1, false);
             fail("Expecting IndexOutOfBoundsException.");
-        } catch (IndexOutOfBoundsException ex) {
+        } catch (final IndexOutOfBoundsException ex) {
             // expected
         }
          try {
             list.getNode(3, true);
             fail("Expecting IndexOutOfBoundsException.");
-        } catch (IndexOutOfBoundsException ex) {
+        } catch (final IndexOutOfBoundsException ex) {
             // expected
         }
     }
 
     protected void checkNodes() {
-        AbstractLinkedList<E> list = getCollection();
+        final AbstractLinkedList<E> list = getCollection();
         for (int i = 0; i < list.size; i++) {
             assertEquals(list.getNode(i, false).next, list.getNode(i + 1, true));
             if (i < list.size - 1) {

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/AbstractListTest.java Mon Jan  7 17:15:14 2013
@@ -60,7 +60,7 @@ public abstract class AbstractListTest<E
      *
      * @param testName  the test class name
      */
-    public AbstractListTest(String testName) {
+    public AbstractListTest(final String testName) {
         super(testName);
     }
 
@@ -86,8 +86,8 @@ public abstract class AbstractListTest<E
     public void verify() {
         super.verify();
 
-        List<E> list1 = getCollection();
-        List<E> list2 = getConfirmed();
+        final List<E> list1 = getCollection();
+        final List<E> list2 = getConfirmed();
 
         assertEquals("List should equal confirmed", list1, list2);
         assertEquals("Confirmed should equal list", list2, list1);
@@ -95,12 +95,12 @@ public abstract class AbstractListTest<E
         assertEquals("Hash codes should be equal", list1.hashCode(), list2.hashCode());
 
         int i = 0;
-        Iterator<E> iterator1 = list1.iterator();
-        Iterator<E> iterator2 = list2.iterator();
-        E[] array = (E[]) list1.toArray();
+        final Iterator<E> iterator1 = list1.iterator();
+        final Iterator<E> iterator2 = list2.iterator();
+        final E[] array = (E[]) list1.toArray();
         while (iterator2.hasNext()) {
             assertTrue("List iterator should have next", iterator1.hasNext());
-            Object o1 = iterator1.next();
+            final Object o1 = iterator1.next();
             Object o2 = iterator2.next();
             assertEquals("Iterator elements should be equal", o1, o2);
             o2 = list1.get(i);
@@ -125,7 +125,7 @@ public abstract class AbstractListTest<E
      */
     @Override
     public Collection<E> makeConfirmedCollection() {
-        ArrayList<E> list = new ArrayList<E>();
+        final ArrayList<E> list = new ArrayList<E>();
         return list;
     }
 
@@ -134,7 +134,7 @@ public abstract class AbstractListTest<E
      */
     @Override
     public Collection<E> makeConfirmedFullCollection() {
-        ArrayList<E> list = new ArrayList<E>();
+        final ArrayList<E> list = new ArrayList<E>();
         list.addAll(Arrays.asList(getFullElements()));
         return list;
     }
@@ -153,7 +153,7 @@ public abstract class AbstractListTest<E
     @Override
     public List<E> makeFullCollection() {
         // only works if list supports optional "addAll(Collection)"
-        List<E> list = makeObject();
+        final List<E> list = makeObject();
         list.addAll(Arrays.asList(getFullElements()));
         return list;
     }
@@ -190,13 +190,13 @@ public abstract class AbstractListTest<E
         }
 
         List<E> list;
-        E element = getOtherElements()[0];
+        final E element = getOtherElements()[0];
 
         try {
             list = makeObject();
             list.add(Integer.MIN_VALUE, element);
             fail("List.add should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -204,7 +204,7 @@ public abstract class AbstractListTest<E
             list = makeObject();
             list.add(-1, element);
             fail("List.add should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -212,7 +212,7 @@ public abstract class AbstractListTest<E
             list = makeObject();
             list.add(1, element);
             fail("List.add should throw IndexOutOfBoundsException [1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -220,7 +220,7 @@ public abstract class AbstractListTest<E
             list = makeObject();
             list.add(Integer.MAX_VALUE, element);
             fail("List.add should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -235,13 +235,13 @@ public abstract class AbstractListTest<E
         }
 
         List<E> list;
-        E element = getOtherElements()[0];
+        final E element = getOtherElements()[0];
 
         try {
             list = makeFullCollection();
             list.add(Integer.MIN_VALUE, element);
             fail("List.add should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -249,7 +249,7 @@ public abstract class AbstractListTest<E
             list = makeFullCollection();
             list.add(-1, element);
             fail("List.add should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -257,7 +257,7 @@ public abstract class AbstractListTest<E
             list = makeFullCollection();
             list.add(list.size() + 1, element);
             fail("List.add should throw IndexOutOfBoundsException [size + 1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -265,7 +265,7 @@ public abstract class AbstractListTest<E
             list = makeFullCollection();
             list.add(Integer.MAX_VALUE, element);
             fail("List.add should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -278,8 +278,8 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        E element = getOtherElements()[0];
-        int max = getFullElements().length;
+        final E element = getOtherElements()[0];
+        final int max = getFullElements().length;
 
         for (int i = 0; i <= max; i++) {
             resetFull();
@@ -345,7 +345,7 @@ public abstract class AbstractListTest<E
         verify();
 
         final List<E> listForC = Arrays.asList(getFullElements());
-        Collection<E> c = new AbstractCollection<E>() {
+        final Collection<E> c = new AbstractCollection<E>() {
             @Override
             public int size() {
                 return listForC.size();
@@ -383,8 +383,8 @@ public abstract class AbstractListTest<E
      */
     public void testListGetByIndex() {
         resetFull();
-        List<E> list = getCollection();
-        E[] elements = getFullElements();
+        final List<E> list = getCollection();
+        final E[] elements = getFullElements();
         for (int i = 0; i < elements.length; i++) {
             assertEquals("List should contain correct elements", elements[i], list.get(i));
             verify();
@@ -396,40 +396,40 @@ public abstract class AbstractListTest<E
      *  empty list.
      */
     public void testListGetByIndexBoundsChecking() {
-        List<E> list = makeObject();
+        final List<E> list = makeObject();
 
         try {
             list.get(Integer.MIN_VALUE);
             fail("List.get should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(-1);
             fail("List.get should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(0);
             fail("List.get should throw IndexOutOfBoundsException [0]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(1);
             fail("List.get should throw IndexOutOfBoundsException [1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(Integer.MAX_VALUE);
             fail("List.get should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -439,33 +439,33 @@ public abstract class AbstractListTest<E
      *  full list.
      */
     public void testListGetByIndexBoundsChecking2() {
-        List<E> list = makeFullCollection();
+        final List<E> list = makeFullCollection();
 
         try {
             list.get(Integer.MIN_VALUE);
             fail("List.get should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(-1);
             fail("List.get should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(getFullElements().length);
             fail("List.get should throw IndexOutOfBoundsException [size]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(Integer.MAX_VALUE);
             fail("List.get should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -475,19 +475,19 @@ public abstract class AbstractListTest<E
      */
     public void testListIndexOf() {
         resetFull();
-        List<E> list1 = getCollection();
-        List<E> list2 = getConfirmed();
+        final List<E> list1 = getCollection();
+        final List<E> list2 = getConfirmed();
 
-        Iterator<E> iterator = list2.iterator();
+        final Iterator<E> iterator = list2.iterator();
         while (iterator.hasNext()) {
-            Object element = iterator.next();
+            final Object element = iterator.next();
             assertEquals("indexOf should return correct result",
                 list1.indexOf(element), list2.indexOf(element));
             verify();
         }
 
-        E[] other = getOtherElements();
-        for (E element : other) {
+        final E[] other = getOtherElements();
+        for (final E element : other) {
             assertEquals("indexOf should return -1 for nonexistent element",
                 -1, list1.indexOf(element));
             verify();
@@ -499,19 +499,19 @@ public abstract class AbstractListTest<E
      */
     public void testListLastIndexOf() {
         resetFull();
-        List<E> list1 = getCollection();
-        List<E> list2 = getConfirmed();
+        final List<E> list1 = getCollection();
+        final List<E> list2 = getConfirmed();
 
-        Iterator<E> iterator = list2.iterator();
+        final Iterator<E> iterator = list2.iterator();
         while (iterator.hasNext()) {
-            E element = iterator.next();
+            final E element = iterator.next();
             assertEquals("lastIndexOf should return correct result",
               list1.lastIndexOf(element), list2.lastIndexOf(element));
             verify();
         }
 
-        E[] other = getOtherElements();
-        for (E element : other) {
+        final E[] other = getOtherElements();
+        for (final E element : other) {
             assertEquals("lastIndexOf should return -1 for nonexistent " +
                 "element", -1, list1.lastIndexOf(element));
             verify();
@@ -527,41 +527,41 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        List<E> list = makeObject();
-        E element = getOtherElements()[0];
+        final List<E> list = makeObject();
+        final E element = getOtherElements()[0];
 
         try {
             list.set(Integer.MIN_VALUE, element);
             fail("List.set should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(-1, element);
             fail("List.set should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(0, element);
             fail("List.set should throw IndexOutOfBoundsException [0]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(1, element);
             fail("List.set should throw IndexOutOfBoundsException [1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(Integer.MAX_VALUE, element);
             fail("List.set should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -576,28 +576,28 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        List<E> list = makeFullCollection();
-        E element = getOtherElements()[0];
+        final List<E> list = makeFullCollection();
+        final E element = getOtherElements()[0];
 
         try {
             list.set(Integer.MIN_VALUE, element);
             fail("List.set should throw IndexOutOfBoundsException " +
               "[Integer.MIN_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(-1, element);
             fail("List.set should throw IndexOutOfBoundsException [-1]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.set(getFullElements().length, element);
             fail("List.set should throw IndexOutOfBoundsException [size]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -605,7 +605,7 @@ public abstract class AbstractListTest<E
             list.set(Integer.MAX_VALUE, element);
             fail("List.set should throw IndexOutOfBoundsException " +
               "[Integer.MAX_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -620,12 +620,12 @@ public abstract class AbstractListTest<E
         }
 
         resetFull();
-        E[] elements = getFullElements();
-        E[] other = getOtherElements();
+        final E[] elements = getFullElements();
+        final E[] other = getOtherElements();
 
         for (int i = 0; i < elements.length; i++) {
-            E n = other[i % other.length];
-            E v = getCollection().set(i, n);
+            final E n = other[i % other.length];
+            final E v = getCollection().set(i, n);
             assertEquals("Set should return correct element", elements[i], v);
             getConfirmed().set(i, n);
             verify();
@@ -645,7 +645,7 @@ public abstract class AbstractListTest<E
         try {
             getCollection().set(0, getFullElements()[0]);
             fail("Emtpy collection should not support set.");
-        } catch (UnsupportedOperationException e) {
+        } catch (final UnsupportedOperationException e) {
             // expected
         }
         // make sure things didn't change even if the expected exception was
@@ -662,40 +662,40 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        List<E> list = makeObject();
+        final List<E> list = makeObject();
 
         try {
             list.remove(Integer.MIN_VALUE);
             fail("List.remove should throw IndexOutOfBoundsException [Integer.MIN_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(-1);
             fail("List.remove should throw IndexOutOfBoundsException [-1]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(0);
             fail("List.remove should throw IndexOutOfBoundsException [0]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(1);
             fail("List.remove should throw IndexOutOfBoundsException [1]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(Integer.MAX_VALUE);
             fail("List.remove should throw IndexOutOfBoundsException [Integer.MAX_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -709,27 +709,27 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        List<E> list = makeFullCollection();
+        final List<E> list = makeFullCollection();
 
         try {
             list.remove(Integer.MIN_VALUE);
             fail("List.remove should throw IndexOutOfBoundsException " +
               "[Integer.MIN_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(-1);
             fail("List.remove should throw IndexOutOfBoundsException [-1]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.remove(getFullElements().length);
             fail("List.remove should throw IndexOutOfBoundsException [size]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -737,7 +737,7 @@ public abstract class AbstractListTest<E
             list.remove(Integer.MAX_VALUE);
             fail("List.remove should throw IndexOutOfBoundsException " +
               "[Integer.MAX_VALUE]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -751,11 +751,11 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        int max = getFullElements().length;
+        final int max = getFullElements().length;
         for (int i = 0; i < max; i++) {
             resetFull();
-            E o1 = getCollection().remove(i);
-            E o2 = getConfirmed().remove(i);
+            final E o1 = getCollection().remove(i);
+            final E o2 = getConfirmed().remove(i);
             assertEquals("remove should return correct element", o1, o2);
             verify();
         }
@@ -777,11 +777,11 @@ public abstract class AbstractListTest<E
         resetFull();
         try {
             getCollection().listIterator(-1);
-        } catch (IndexOutOfBoundsException ex) {}
+        } catch (final IndexOutOfBoundsException ex) {}
         resetFull();
         try {
             getCollection().listIterator(getCollection().size() + 1);
-        } catch (IndexOutOfBoundsException ex) {}
+        } catch (final IndexOutOfBoundsException ex) {}
         resetFull();
         for (int i = 0; i <= getConfirmed().size(); i++) {
             forwardTest(getCollection().listIterator(i), i);
@@ -805,12 +805,12 @@ public abstract class AbstractListTest<E
         if (getCollection().size() < 4) {
             return;
         }
-        ListIterator<E> it = getCollection().listIterator();
-        E zero = it.next();
-        E one = it.next();
-        E two = it.next();
-        E two2 = it.previous();
-        E one2 = it.previous();
+        final ListIterator<E> it = getCollection().listIterator();
+        final E zero = it.next();
+        final E one = it.next();
+        final E two = it.next();
+        final E two2 = it.previous();
+        final E one2 = it.previous();
         assertEquals(one, one2);
         assertEquals(two, two2);
         assertEquals(zero, getCollection().get(0));
@@ -820,7 +820,7 @@ public abstract class AbstractListTest<E
         it.remove(); // removed element at index 1 (one)
         assertEquals(zero, getCollection().get(0));
         assertEquals(two, getCollection().get(1));
-        E two3 = it.next();  // do next after remove
+        final E two3 = it.next();  // do next after remove
         assertEquals(two, two3);
         assertEquals(getCollection().size() > 2, it.hasNext());
         assertEquals(true, it.hasPrevious());
@@ -837,12 +837,12 @@ public abstract class AbstractListTest<E
         if (getCollection().size() < 4) {
             return;
         }
-        ListIterator<E> it = getCollection().listIterator();
-        E zero = it.next();
-        E one = it.next();
-        E two = it.next();
-        E two2 = it.previous();
-        E one2 = it.previous();
+        final ListIterator<E> it = getCollection().listIterator();
+        final E zero = it.next();
+        final E one = it.next();
+        final E two = it.next();
+        final E two2 = it.previous();
+        final E one2 = it.previous();
         assertEquals(one, one2);
         assertEquals(two, two2);
         assertEquals(zero, getCollection().get(0));
@@ -852,7 +852,7 @@ public abstract class AbstractListTest<E
         it.remove(); // removed element at index 1 (one)
         assertEquals(zero, getCollection().get(0));
         assertEquals(two, getCollection().get(1));
-        E zero3 = it.previous();  // do previous after remove
+        final E zero3 = it.previous();  // do previous after remove
         assertEquals(zero, zero3);
         assertEquals(false, it.hasPrevious());
         assertEquals(getCollection().size() > 2, it.hasNext());
@@ -869,19 +869,19 @@ public abstract class AbstractListTest<E
         if (getCollection().size() < 4) {
             return;
         }
-        ListIterator<E> it = getCollection().listIterator();
-        E zero = it.next();
-        E one = it.next();
-        E two = it.next();
+        final ListIterator<E> it = getCollection().listIterator();
+        final E zero = it.next();
+        final E one = it.next();
+        final E two = it.next();
         assertEquals(zero, getCollection().get(0));
         assertEquals(one, getCollection().get(1));
         assertEquals(two, getCollection().get(2));
-        E three = getCollection().get(3);
+        final E three = getCollection().get(3);
 
         it.remove(); // removed element at index 2 (two)
         assertEquals(zero, getCollection().get(0));
         assertEquals(one, getCollection().get(1));
-        E three2 = it.next();  // do next after remove
+        final E three2 = it.next();  // do next after remove
         assertEquals(three, three2);
         assertEquals(getCollection().size() > 3, it.hasNext());
         assertEquals(true, it.hasPrevious());
@@ -898,10 +898,10 @@ public abstract class AbstractListTest<E
         if (getCollection().size() < 4) {
             return;
         }
-        ListIterator<E> it = getCollection().listIterator();
-        E zero = it.next();
-        E one = it.next();
-        E two = it.next();
+        final ListIterator<E> it = getCollection().listIterator();
+        final E zero = it.next();
+        final E one = it.next();
+        final E two = it.next();
         assertEquals(zero, getCollection().get(0));
         assertEquals(one, getCollection().get(1));
         assertEquals(two, getCollection().get(2));
@@ -909,7 +909,7 @@ public abstract class AbstractListTest<E
         it.remove(); // removed element at index 2 (two)
         assertEquals(zero, getCollection().get(0));
         assertEquals(one, getCollection().get(1));
-        E one2 = it.previous();  // do previous after remove
+        final E one2 = it.previous();  // do previous after remove
         assertEquals(one, one2);
         assertEquals(true, it.hasNext());
         assertEquals(true, it.hasPrevious());
@@ -922,9 +922,9 @@ public abstract class AbstractListTest<E
      *  @param iter  the iterator to traverse
      *  @param i     the starting index
      */
-    private void forwardTest(ListIterator<E> iter, int i) {
-        List<E> list = getCollection();
-        int max = getFullElements().length;
+    private void forwardTest(final ListIterator<E> iter, int i) {
+        final List<E> list = getCollection();
+        final int max = getFullElements().length;
 
         while (i < max) {
             assertTrue("Iterator should have next", iter.hasNext());
@@ -932,7 +932,7 @@ public abstract class AbstractListTest<E
                 i, iter.nextIndex());
             assertEquals("Iterator.previousIndex should work",
                 i - 1, iter.previousIndex());
-            Object o = iter.next();
+            final Object o = iter.next();
             assertEquals("Iterator returned correct element", list.get(i), o);
             i++;
         }
@@ -944,7 +944,7 @@ public abstract class AbstractListTest<E
         try {
             iter.next();
             fail("Exhausted iterator should raise NoSuchElement");
-        } catch (NoSuchElementException e) {
+        } catch (final NoSuchElementException e) {
             // expected
         }
     }
@@ -955,8 +955,8 @@ public abstract class AbstractListTest<E
      *  @param iter  the iterator to traverse
      *  @param i     the starting index
      */
-    private void backwardTest(ListIterator<E> iter, int i) {
-        List<E> list = getCollection();
+    private void backwardTest(final ListIterator<E> iter, int i) {
+        final List<E> list = getCollection();
 
         while (i > 0) {
             assertTrue("Iterator should have previous, i:" + i,
@@ -965,22 +965,22 @@ public abstract class AbstractListTest<E
                 i, iter.nextIndex());
             assertEquals("Iterator.previousIndex should work, i:" + i,
                 i - 1, iter.previousIndex());
-            E o = iter.previous();
+            final E o = iter.previous();
             assertEquals("Iterator returned correct element",
                 list.get(i - 1), o);
             i--;
         }
 
         assertTrue("Iterator shouldn't have previous", !iter.hasPrevious());
-        int nextIndex = iter.nextIndex();
+        final int nextIndex = iter.nextIndex();
         assertEquals("nextIndex should be 0", 0, nextIndex);
-        int prevIndex = iter.previousIndex();
+        final int prevIndex = iter.previousIndex();
         assertEquals("previousIndex should be -1", -1, prevIndex);
 
         try {
             iter.previous();
             fail("Exhausted iterator should raise NoSuchElement");
-        } catch (NoSuchElementException e) {
+        } catch (final NoSuchElementException e) {
             // expected
         }
 
@@ -997,14 +997,14 @@ public abstract class AbstractListTest<E
         }
 
         resetEmpty();
-        List<E> list1 = getCollection();
-        List<E> list2 = getConfirmed();
+        final List<E> list1 = getCollection();
+        final List<E> list2 = getConfirmed();
 
-        E[] elements = getFullElements();
+        final E[] elements = getFullElements();
         ListIterator<E> iter1 = list1.listIterator();
         ListIterator<E> iter2 = list2.listIterator();
 
-        for (E element : elements) {
+        for (final E element : elements) {
             iter1.add(element);
             iter2.add(element);
             verify();
@@ -1013,7 +1013,7 @@ public abstract class AbstractListTest<E
         resetFull();
         iter1 = getCollection().listIterator();
         iter2 = getConfirmed().listIterator();
-        for (E element : elements) {
+        for (final E element : elements) {
             iter1.next();
             iter2.next();
             iter1.add(element);
@@ -1031,12 +1031,12 @@ public abstract class AbstractListTest<E
             return;
         }
 
-        E[] elements = getFullElements();
+        final E[] elements = getFullElements();
 
         resetFull();
-        ListIterator<E> iter1 = getCollection().listIterator();
-        ListIterator<E> iter2 = getConfirmed().listIterator();
-        for (E element : elements) {
+        final ListIterator<E> iter1 = getCollection().listIterator();
+        final ListIterator<E> iter2 = getConfirmed().listIterator();
+        for (final E element : elements) {
             iter1.next();
             iter2.next();
             iter1.set(element);
@@ -1047,13 +1047,13 @@ public abstract class AbstractListTest<E
 
     @SuppressWarnings("unchecked")
     public void testEmptyListSerialization() throws IOException, ClassNotFoundException {
-        List<E> list = makeObject();
+        final List<E> list = makeObject();
         if (!(list instanceof Serializable && isTestSerialization())) {
             return;
         }
 
-        byte[] objekt = writeExternalFormToBytes((Serializable) list);
-        List<E> list2 = (List<E>) readExternalFormFromBytes(objekt);
+        final byte[] objekt = writeExternalFormToBytes((Serializable) list);
+        final List<E> list2 = (List<E>) readExternalFormFromBytes(objekt);
 
         assertEquals("Both lists are empty", 0, list.size());
         assertEquals("Both lists are empty", 0, list2.size());
@@ -1061,14 +1061,14 @@ public abstract class AbstractListTest<E
 
     @SuppressWarnings("unchecked")
     public void testFullListSerialization() throws IOException, ClassNotFoundException {
-        List<E> list = makeFullCollection();
-        int size = getFullElements().length;
+        final List<E> list = makeFullCollection();
+        final int size = getFullElements().length;
         if (!(list instanceof Serializable && isTestSerialization())) {
             return;
         }
 
-        byte[] objekt = writeExternalFormToBytes((Serializable) list);
-        List<E> list2 = (List<E>) readExternalFormFromBytes(objekt);
+        final byte[] objekt = writeExternalFormToBytes((Serializable) list);
+        final List<E> list2 = (List<E>) readExternalFormFromBytes(objekt);
 
         assertEquals("Both lists are same size", size, list.size());
         assertEquals("Both lists are same size", size, list2.size());
@@ -1101,10 +1101,10 @@ public abstract class AbstractListTest<E
         */
 
         // test to make sure the canonical form has been preserved
-        List<E> list = makeObject();
+        final List<E> list = makeObject();
         if (list instanceof Serializable && !skipSerializedCanonicalTests()
                 && isTestSerialization()) {
-            List<E> list2 = (List<E>) readExternalFormFromDisk(getCanonicalEmptyCollectionName(list));
+            final List<E> list2 = (List<E>) readExternalFormFromDisk(getCanonicalEmptyCollectionName(list));
             assertEquals("List is empty", 0, list2.size());
             assertEquals(list, list2);
         }
@@ -1125,9 +1125,9 @@ public abstract class AbstractListTest<E
         */
 
         // test to make sure the canonical form has been preserved
-        List<E> list = makeFullCollection();
+        final List<E> list = makeFullCollection();
         if(list instanceof Serializable && !skipSerializedCanonicalTests() && isTestSerialization()) {
-            List<E> list2 = (List<E>) readExternalFormFromDisk(getCanonicalFullCollectionName(list));
+            final List<E> list2 = (List<E>) readExternalFormFromDisk(getCanonicalFullCollectionName(list));
             if (list2.size() == 4) {
                 // old serialized tests
                 return;
@@ -1157,9 +1157,9 @@ public abstract class AbstractListTest<E
 
    public static class BulkTestSubList<E> extends AbstractListTest<E> {
 
-       private AbstractListTest<E> outer;
+       private final AbstractListTest<E> outer;
 
-       public BulkTestSubList(AbstractListTest<E> outer) {
+       public BulkTestSubList(final AbstractListTest<E> outer) {
            super("");
            this.outer = outer;
        }
@@ -1167,7 +1167,7 @@ public abstract class AbstractListTest<E
        @Override
        @SuppressWarnings("unchecked")
        public E[] getFullElements() {
-           List<E> l = Arrays.asList(outer.getFullElements());
+           final List<E> l = Arrays.asList(outer.getFullElements());
            return (E[]) l.subList(3, l.size() - 3).toArray();
        }
 
@@ -1198,7 +1198,7 @@ public abstract class AbstractListTest<E
 
        @Override
        public List<E> makeFullCollection() {
-           int size = getFullElements().length;
+           final int size = getFullElements().length;
            return outer.makeFullCollection().subList(3, size - 3);
        }
 
@@ -1212,7 +1212,7 @@ public abstract class AbstractListTest<E
        @Override
        public void resetFull() {
            outer.resetFull();
-           int size = outer.getConfirmed().size();
+           final int size = outer.getConfirmed().size();
            this.setCollection(outer.getCollection().subList(3, size - 3));
            this.setConfirmed(outer.getConfirmed().subList(3, size - 3));
        }
@@ -1242,7 +1242,7 @@ public abstract class AbstractListTest<E
     }
 
        resetFull();
-       int size = getCollection().size();
+       final int size = getCollection().size();
        List<E> sub = getCollection().subList(1, size);
        getCollection().add(getOtherElements()[0]);
        failFastAll(sub);
@@ -1276,7 +1276,7 @@ public abstract class AbstractListTest<E
     }
 
        resetFull();
-       int size = getCollection().size();
+       final int size = getCollection().size();
        List<E> sub = getCollection().subList(1, size);
        getCollection().remove(0);
        failFastAll(sub);
@@ -1306,9 +1306,9 @@ public abstract class AbstractListTest<E
     *  Invokes all the methods on the given sublist to make sure they raise
     *  a {@link java.util.ConcurrentModificationException ConcurrentModificationException}.
     */
-   protected void failFastAll(List<E> list) {
-       Method[] methods = List.class.getMethods();
-       for (Method method : methods) {
+   protected void failFastAll(final List<E> list) {
+       final Method[] methods = List.class.getMethods();
+       for (final Method method : methods) {
            failFastMethod(list, method);
        }
    }
@@ -1325,16 +1325,16 @@ public abstract class AbstractListTest<E
     *  @param list  the sublist to test
     *  @param m     the method to invoke
     */
-   protected void failFastMethod(List<E> list, Method m) {
+   protected void failFastMethod(final List<E> list, final Method m) {
        if (m.getName().equals("equals")) {
         return;
     }
 
-       E element = getOtherElements()[0];
-       Collection<E> c = Collections.singleton(element);
+       final E element = getOtherElements()[0];
+       final Collection<E> c = Collections.singleton(element);
 
-       Class<?>[] types = m.getParameterTypes();
-       Object[] params = new Object[types.length];
+       final Class<?>[] types = m.getParameterTypes();
+       final Object[] params = new Object[types.length];
        for (int i = 0; i < params.length; i++) {
            if (types[i] == Integer.TYPE) {
             params[i] = new Integer(0);
@@ -1350,10 +1350,10 @@ public abstract class AbstractListTest<E
        try {
            m.invoke(list, params);
            fail(m.getName() + " should raise ConcurrentModification");
-       } catch (IllegalAccessException e) {
+       } catch (final IllegalAccessException e) {
            // impossible
-       } catch (InvocationTargetException e) {
-           Throwable t = e.getTargetException();
+       } catch (final InvocationTargetException e) {
+           final Throwable t = e.getTargetException();
            if (t instanceof ConcurrentModificationException) {
                // expected
                return;

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/CursorableLinkedListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/CursorableLinkedListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/CursorableLinkedListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/CursorableLinkedListTest.java Mon Jan  7 17:15:14 2013
@@ -37,7 +37,7 @@ import org.apache.commons.collections.Bu
  * @author Simon Kitching
  */
 public class CursorableLinkedListTest<E> extends AbstractLinkedListTest<E> {
-    public CursorableLinkedListTest(String testName) {
+    public CursorableLinkedListTest(final String testName) {
         super(testName);
     }
 
@@ -77,7 +77,7 @@ public class CursorableLinkedListTest<E>
         list.add(7,(E) new Integer(5));
         assertEquals("[-2, -1, 0, 1, 2, 3, 4, 5]",list.toString());
 
-        java.util.List<E> list2 = new java.util.LinkedList<E>();
+        final java.util.List<E> list2 = new java.util.LinkedList<E>();
         list2.add((E) "A");
         list2.add((E) "B");
         list2.add((E) "C");
@@ -142,7 +142,7 @@ public class CursorableLinkedListTest<E>
     @SuppressWarnings("unchecked")
     public void testContainsAll() {
         assertTrue(list.containsAll(list));
-        java.util.List<E> list2 = new java.util.LinkedList<E>();
+        final java.util.List<E> list2 = new java.util.LinkedList<E>();
         assertTrue(list.containsAll(list2));
         list2.add((E) "A");
         assertTrue(!list.containsAll(list2));
@@ -167,7 +167,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "4");
         list.add((E) "5");
-        CursorableLinkedList.Cursor<E> it = list.cursor();
+        final CursorableLinkedList.Cursor<E> it = list.cursor();
         assertTrue(it.hasNext());
         assertTrue(!it.hasPrevious());
         assertEquals("1", it.next());
@@ -223,7 +223,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> it = list.cursor();
+        final CursorableLinkedList.Cursor<E> it = list.cursor();
         assertEquals("1", it.next());
         it.set((E) "a");
         assertEquals("a", it.previous());
@@ -248,11 +248,11 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> it = list.cursor();
+        final CursorableLinkedList.Cursor<E> it = list.cursor();
         try {
             it.remove();
             fail();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             // expected
         }
         assertEquals("1", it.next());
@@ -271,7 +271,7 @@ public class CursorableLinkedListTest<E>
         assertEquals("[4, 5]", list.toString());
         try {
             it.remove();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             // expected
         }
         assertEquals("4", it.next());
@@ -286,7 +286,7 @@ public class CursorableLinkedListTest<E>
 
     @SuppressWarnings("unchecked")
     public void testCursorAdd() {
-        CursorableLinkedList.Cursor<E> it = list.cursor();
+        final CursorableLinkedList.Cursor<E> it = list.cursor();
         it.add((E) "1");
         assertEquals("[1]", list.toString());
         it.add((E) "3");
@@ -314,9 +314,9 @@ public class CursorableLinkedListTest<E>
         list.add((E) "7");
         list.add((E) "9");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
-        CursorableLinkedList.Cursor<E> c2 = list.cursor();
-        Iterator<E> li = list.iterator();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c2 = list.cursor();
+        final Iterator<E> li = list.iterator();
 
         // test cursors remain valid when list modified by std Iterator
         // test cursors skip elements removed via ListIterator
@@ -358,13 +358,13 @@ public class CursorableLinkedListTest<E>
         try {
             c2.next();
             fail();
-        } catch (NoSuchElementException nse) {
+        } catch (final NoSuchElementException nse) {
         }
 
         try {
             li.next();
             fail();
-        } catch (ConcurrentModificationException cme) {
+        } catch (final ConcurrentModificationException cme) {
         }
 
         c1.close(); // not necessary
@@ -378,8 +378,8 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
-        Iterator<E> li = list.iterator();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final Iterator<E> li = list.iterator();
 
         // test cursors remain valid when list modified by std Iterator
         // test cursors skip elements removed via ListIterator
@@ -399,7 +399,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
 
         assertEquals(0, c1.nextIndex());
         list.remove(0);
@@ -416,7 +416,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
 
         assertEquals(0, c1.nextIndex());
         assertEquals("1", c1.next());
@@ -432,7 +432,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
 
         assertEquals(0, c1.nextIndex());
         list.add(0, (E) "0");
@@ -449,7 +449,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "5");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
 
         assertEquals(0, c1.nextIndex());
         list.add(1, (E) "0");
@@ -466,7 +466,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("B", c1.previous());
@@ -485,7 +485,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -494,7 +494,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
 
         assertEquals("B", list.remove(1));
@@ -511,7 +511,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -520,7 +520,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -538,7 +538,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -548,7 +548,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "C");
         list.add((E) "D");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("C", c1.next());
@@ -566,7 +566,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -576,7 +576,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("B", c1.previous());
@@ -593,7 +593,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -602,7 +602,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -618,7 +618,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -628,7 +628,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("B", c1.previous());
@@ -646,7 +646,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -655,7 +655,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
 
         list.add(1, (E) "Z");
@@ -671,7 +671,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -680,7 +680,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -696,7 +696,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -706,7 +706,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("B", c1.previous());
@@ -722,7 +722,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -731,7 +731,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -747,7 +747,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -757,7 +757,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -772,7 +772,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.set((E) "Z");
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -782,7 +782,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
         assertEquals("B", c1.previous());
@@ -800,7 +800,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     @SuppressWarnings("unchecked")
@@ -809,7 +809,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "B");
         list.add((E) "C");
 
-        CursorableLinkedList.Cursor<E> c1 = list.cursor();
+        final CursorableLinkedList.Cursor<E> c1 = list.cursor();
         assertEquals("A", c1.next());
         assertEquals("B", c1.next());
 
@@ -826,7 +826,7 @@ public class CursorableLinkedListTest<E>
         try {
             c1.remove();
             fail();
-        } catch (IllegalStateException ex) {}
+        } catch (final IllegalStateException ex) {}
     }
 
     //-----------------------------------------------------------------------
@@ -838,11 +838,11 @@ public class CursorableLinkedListTest<E>
         assertTrue(list.equals(list));
         assertEquals(list.hashCode(),list.hashCode());
 
-        CursorableLinkedList<E> list2 = new CursorableLinkedList<E>();
+        final CursorableLinkedList<E> list2 = new CursorableLinkedList<E>();
         assertTrue(!list.equals(list2));
         assertTrue(!list2.equals(list));
 
-        java.util.List<E> list3 = new java.util.LinkedList<E>();
+        final java.util.List<E> list3 = new java.util.LinkedList<E>();
         assertTrue(!list.equals(list3));
         assertTrue(!list3.equals(list));
         assertTrue(list2.equals(list3));
@@ -899,7 +899,7 @@ public class CursorableLinkedListTest<E>
         try {
             list.get(0);
             fail("shouldn't get here");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
@@ -912,14 +912,14 @@ public class CursorableLinkedListTest<E>
         try {
             list.get(-1);
             fail("shouldn't get here");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
 
         try {
             list.get(2);
             fail("shouldn't get here");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -1009,7 +1009,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "3");
         list.add((E) "4");
         list.add((E) "5");
-        ListIterator<E> it = list.listIterator();
+        final ListIterator<E> it = list.listIterator();
         assertTrue(it.hasNext());
         assertTrue(!it.hasPrevious());
         assertEquals(-1, it.previousIndex());
@@ -1095,7 +1095,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        ListIterator<E> it = list.listIterator();
+        final ListIterator<E> it = list.listIterator();
         assertEquals("1", it.next());
         it.set((E) "a");
         assertEquals("a", it.previous());
@@ -1119,10 +1119,10 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        ListIterator<E> it = list.listIterator();
+        final ListIterator<E> it = list.listIterator();
         try {
             it.remove();
-        } catch(IllegalStateException e) {
+        } catch(final IllegalStateException e) {
             // expected
         }
         assertEquals("1",it.next());
@@ -1141,7 +1141,7 @@ public class CursorableLinkedListTest<E>
         assertEquals("[4, 5]",list.toString());
         try {
             it.remove();
-        } catch(IllegalStateException e) {
+        } catch(final IllegalStateException e) {
             // expected
         }
         assertEquals("4",it.next());
@@ -1156,7 +1156,7 @@ public class CursorableLinkedListTest<E>
     @Override
     @SuppressWarnings("unchecked")
     public void testListIteratorAdd() {
-        ListIterator<E> it = list.listIterator();
+        final ListIterator<E> it = list.listIterator();
         it.add((E) "1");
         assertEquals("[1]", list.toString());
         it.add((E) "3");
@@ -1180,7 +1180,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        HashSet<E> set = new HashSet<E>();
+        final HashSet<E> set = new HashSet<E>();
         set.add((E) "A");
         set.add((E) "2");
         set.add((E) "C");
@@ -1262,7 +1262,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "5");
         list.add((E) "5");
 
-        HashSet<E> set = new HashSet<E>();
+        final HashSet<E> set = new HashSet<E>();
         set.add((E) "A");
         set.add((E) "2");
         set.add((E) "C");
@@ -1319,7 +1319,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "D");
         list.add((E) "E");
 
-        List<E> sublist = list.subList(5, 5);
+        final List<E> sublist = list.subList(5, 5);
         sublist.add((E) "F");
         assertEquals("[A, B, C, D, E, F]", list.toString());
         assertEquals("[F]", sublist.toString());
@@ -1336,7 +1336,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "D");
         list.add((E) "E");
 
-        List<E> sublist = list.subList(0, 0);
+        final List<E> sublist = list.subList(0, 0);
         sublist.add((E) "a");
         assertEquals("[a, A, B, C, D, E]", list.toString());
         assertEquals("[a]", sublist.toString());
@@ -1353,7 +1353,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "D");
         list.add((E) "E");
 
-        List<E> sublist = list.subList(1, 3);
+        final List<E> sublist = list.subList(1, 3);
         sublist.add((E) "a");
         assertEquals("[A, B, C, a, D, E]", list.toString());
         assertEquals("[B, C, a]", sublist.toString());
@@ -1370,7 +1370,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "D");
         list.add((E) "E");
 
-        List<E> sublist = list.subList(1, 4);
+        final List<E> sublist = list.subList(1, 4);
         assertEquals("[B, C, D]", sublist.toString());
         assertEquals("[A, B, C, D, E]", list.toString());
         sublist.remove("C");
@@ -1392,7 +1392,7 @@ public class CursorableLinkedListTest<E>
         list.add((E) "4");
         list.add((E) "5");
 
-        Object[] elts = list.toArray();
+        final Object[] elts = list.toArray();
         assertEquals("1", elts[0]);
         assertEquals("2", elts[1]);
         assertEquals("3", elts[2]);
@@ -1400,7 +1400,7 @@ public class CursorableLinkedListTest<E>
         assertEquals("5", elts[4]);
         assertEquals(5, elts.length);
 
-        String[] elts2 = list.toArray(new String[0]);
+        final String[] elts2 = list.toArray(new String[0]);
         assertEquals("1", elts2[0]);
         assertEquals("2", elts2[1]);
         assertEquals("3", elts2[2]);
@@ -1408,7 +1408,7 @@ public class CursorableLinkedListTest<E>
         assertEquals("5", elts2[4]);
         assertEquals(5, elts2.length);
 
-        String[] elts3 = new String[5];
+        final String[] elts3 = new String[5];
         assertSame(elts3, list.toArray(elts3));
         assertEquals("1", elts3[0]);
         assertEquals("2", elts3[1]);
@@ -1417,8 +1417,8 @@ public class CursorableLinkedListTest<E>
         assertEquals("5", elts3[4]);
         assertEquals(5, elts3.length);
 
-        String[] elts4 = new String[3];
-        String[] elts4b = list.toArray(elts4);
+        final String[] elts4 = new String[3];
+        final String[] elts4b = list.toArray(elts4);
         assertTrue(elts4 != elts4b);
         assertEquals("1", elts4b[0]);
         assertEquals("2", elts4b[1]);
@@ -1436,15 +1436,15 @@ public class CursorableLinkedListTest<E>
         list.add((E) "D");
         list.add((E) "E");
 
-        java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
-        java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
+        final java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
+        final java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
         out.writeObject(list);
         out.flush();
         out.close();
 
-        java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
-        java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
-        Object list2 = in.readObject();
+        final java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
+        final java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
+        final Object list2 = in.readObject();
 
         assertTrue(list != list2);
         assertTrue(list2.equals(list));
@@ -1458,15 +1458,15 @@ public class CursorableLinkedListTest<E>
         list.add((E) "C");
         list.add((E) "D");
         list.add((E) "E");
-        java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
-        java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
+        final java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
+        final java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
         out.writeObject(list);
         out.flush();
         out.close();
 
-        java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
-        java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
-        Object list2 = in.readObject();
+        final java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
+        final java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
+        final Object list2 = in.readObject();
 
         assertTrue(list != list2);
         assertTrue(list2.equals(list));
@@ -1481,15 +1481,15 @@ public class CursorableLinkedListTest<E>
             list.add((E) new Integer(i));
         }
 
-        java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
-        java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
+        final java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
+        final java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(buf);
         out.writeObject(list);
         out.flush();
         out.close();
 
-        java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
-        java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
-        Object list2 = in.readObject();
+        final java.io.ByteArrayInputStream bufin = new java.io.ByteArrayInputStream(buf.toByteArray());
+        final java.io.ObjectInputStream in = new java.io.ObjectInputStream(bufin);
+        final Object list2 = in.readObject();
 
         assertTrue(list != list2);
         assertTrue(list2.equals(list));
@@ -1503,10 +1503,10 @@ public class CursorableLinkedListTest<E>
      */
     @Override
     public String[] ignoredTests() {
-        ArrayList<String> list = new ArrayList<String>();
-        String prefix = "CursorableLinkedListTest";
-        String bulk = ".bulkTestSubList";
-        String[] ignored = new String[] {
+        final ArrayList<String> list = new ArrayList<String>();
+        final String prefix = "CursorableLinkedListTest";
+        final String bulk = ".bulkTestSubList";
+        final String[] ignored = new String[] {
                 ".testEmptyListSerialization",
                 ".testFullListSerialization",
                 ".testEmptyListCompatibility",
@@ -1516,7 +1516,7 @@ public class CursorableLinkedListTest<E>
                 ".testCanonicalFullCollectionExists",
                 ".testSerializeDeserializeThenCompare"
         };
-        for (String element : ignored) {
+        for (final String element : ignored) {
             list.add(prefix + bulk + element);
             list.add(prefix + bulk + bulk + element);
         }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/FixedSizeListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/FixedSizeListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/FixedSizeListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/FixedSizeListTest.java Mon Jan  7 17:15:14 2013
@@ -31,7 +31,7 @@ import java.util.List;
  */
 public class FixedSizeListTest<E> extends AbstractListTest<E> {
 
-    public FixedSizeListTest(String testName) {
+    public FixedSizeListTest(final String testName) {
         super(testName);
     }
 
@@ -42,7 +42,7 @@ public class FixedSizeListTest<E> extend
 
     @Override
     public List<E> makeFullCollection() {
-        List<E> list = new ArrayList<E>();
+        final List<E> list = new ArrayList<E>();
         list.addAll(Arrays.asList(getFullElements()));
         return FixedSizeList.fixedSizeList(list);
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/GrowthListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/GrowthListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/GrowthListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/GrowthListTest.java Mon Jan  7 17:15:14 2013
@@ -31,7 +31,7 @@ import java.util.List;
  */
 public class GrowthListTest<E> extends AbstractListTest<E> {
 
-    public GrowthListTest(String testName) {
+    public GrowthListTest(final String testName) {
         super(testName);
     }
 
@@ -42,15 +42,15 @@ public class GrowthListTest<E> extends A
 
     @Override
     public List<E> makeFullCollection() {
-        List<E> list = new ArrayList<E>();
+        final List<E> list = new ArrayList<E>();
         list.addAll(Arrays.asList(getFullElements()));
         return GrowthList.growthList(list);
     }
 
     //-----------------------------------------------------------------------
     public void testGrowthAdd() {
-        Integer one = new Integer(1);
-        GrowthList<Integer> grower = new GrowthList<Integer>();
+        final Integer one = new Integer(1);
+        final GrowthList<Integer> grower = new GrowthList<Integer>();
         assertEquals(0, grower.size());
         grower.add(1, one);
         assertEquals(2, grower.size());
@@ -59,12 +59,12 @@ public class GrowthListTest<E> extends A
     }
 
     public void testGrowthAddAll() {
-        Integer one = new Integer(1);
-        Integer two = new Integer(2);
-        Collection<Integer> coll = new ArrayList<Integer>();
+        final Integer one = new Integer(1);
+        final Integer two = new Integer(2);
+        final Collection<Integer> coll = new ArrayList<Integer>();
         coll.add(one);
         coll.add(two);
-        GrowthList<Integer> grower = new GrowthList<Integer>();
+        final GrowthList<Integer> grower = new GrowthList<Integer>();
         assertEquals(0, grower.size());
         grower.addAll(1, coll);
         assertEquals(3, grower.size());
@@ -74,8 +74,8 @@ public class GrowthListTest<E> extends A
     }
 
     public void testGrowthSet1() {
-        Integer one = new Integer(1);
-        GrowthList<Integer> grower = new GrowthList<Integer>();
+        final Integer one = new Integer(1);
+        final GrowthList<Integer> grower = new GrowthList<Integer>();
         assertEquals(0, grower.size());
         grower.set(1, one);
         assertEquals(2, grower.size());
@@ -84,8 +84,8 @@ public class GrowthListTest<E> extends A
     }
 
     public void testGrowthSet2() {
-        Integer one = new Integer(1);
-        GrowthList<Integer> grower = new GrowthList<Integer>();
+        final Integer one = new Integer(1);
+        final GrowthList<Integer> grower = new GrowthList<Integer>();
         assertEquals(0, grower.size());
         grower.set(0, one);
         assertEquals(1, grower.size());
@@ -99,12 +99,12 @@ public class GrowthListTest<E> extends A
     @Override
     public void testListAddByIndexBoundsChecking() {
         List<E> list;
-        E element = getOtherElements()[0];
+        final E element = getOtherElements()[0];
         try {
             list = makeObject();
             list.add(-1, element);
             fail("List.add should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -115,12 +115,12 @@ public class GrowthListTest<E> extends A
     @Override
     public void testListAddByIndexBoundsChecking2() {
         List<E> list;
-        E element = getOtherElements()[0];
+        final E element = getOtherElements()[0];
         try {
             list = makeFullCollection();
             list.add(-1, element);
             fail("List.add should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -130,12 +130,12 @@ public class GrowthListTest<E> extends A
      */
     @Override
     public void testListSetByIndexBoundsChecking() {
-        List<E> list = makeObject();
-        E element = getOtherElements()[0];
+        final List<E> list = makeObject();
+        final E element = getOtherElements()[0];
         try {
             list.set(-1, element);
             fail("List.set should throw IndexOutOfBoundsException [-1]");
-        } catch (IndexOutOfBoundsException e) {
+        } catch (final IndexOutOfBoundsException e) {
             // expected
         }
     }
@@ -145,12 +145,12 @@ public class GrowthListTest<E> extends A
      */
     @Override
     public void testListSetByIndexBoundsChecking2() {
-        List<E> list = makeFullCollection();
-        E element = getOtherElements()[0];
+        final List<E> list = makeFullCollection();
+        final E element = getOtherElements()[0];
         try {
             list.set(-1, element);
             fail("List.set should throw IndexOutOfBoundsException [-1]");
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             // expected
         } 
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/NodeCachingLinkedListTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/NodeCachingLinkedListTest.java?rev=1429905&r1=1429904&r2=1429905&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/NodeCachingLinkedListTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/NodeCachingLinkedListTest.java Mon Jan  7 17:15:14 2013
@@ -33,7 +33,7 @@ import org.apache.commons.collections.Bu
  */
 public class NodeCachingLinkedListTest<E> extends AbstractLinkedListTest<E> {
 
-    public NodeCachingLinkedListTest(String testName) {
+    public NodeCachingLinkedListTest(final String testName) {
         super(testName);
     }
 
@@ -59,7 +59,7 @@ public class NodeCachingLinkedListTest<E
             return;
         }
         resetEmpty();
-        NodeCachingLinkedList<E> list = getCollection();
+        final NodeCachingLinkedList<E> list = getCollection();
 
         list.addAll(Arrays.asList((E[]) new String[] { "1", "2", "3", "4" }));
         list.removeAllNodes(); // Will dump all 4 elements into cache
@@ -76,13 +76,13 @@ public class NodeCachingLinkedListTest<E
 
     //-----------------------------------------------------------------------
     public static void compareSpeed() {
-        NodeCachingLinkedList<Object> ncll = new NodeCachingLinkedList<Object>();
-        LinkedList<Object> ll = new LinkedList<Object>();
+        final NodeCachingLinkedList<Object> ncll = new NodeCachingLinkedList<Object>();
+        final LinkedList<Object> ll = new LinkedList<Object>();
 
-        Object o1 = new Object();
-        Object o2 = new Object();
+        final Object o1 = new Object();
+        final Object o2 = new Object();
 
-        int loopCount = 4000000;
+        final int loopCount = 4000000;
 
         long startTime, endTime;
 



Mime
View raw message