commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [3/4] [text] apply (relaxed) checkstyle rules to test and fix (or suppress) existing violations (closes #71)
Date Thu, 26 Oct 2017 08:07:05 GMT
http://git-wip-us.apache.org/repos/asf/commons-text/blob/6665a020/src/test/java/org/apache/commons/text/StrBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/StrBuilderTest.java b/src/test/java/org/apache/commons/text/StrBuilderTest.java
index 6118dcf..1cc5752 100644
--- a/src/test/java/org/apache/commons/text/StrBuilderTest.java
+++ b/src/test/java/org/apache/commons/text/StrBuilderTest.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,8 +17,14 @@
 
 package org.apache.commons.text;
 
-import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.io.Reader;
@@ -30,12 +36,14 @@ import java.nio.CharBuffer;
 import java.nio.charset.Charset;
 import java.util.Arrays;
 
+import org.junit.Test;
+
 /**
  * Unit tests for {@link StrBuilder}.
  */
 public class StrBuilderTest {
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructors() {
         final StrBuilder sb0 = new StrBuilder();
@@ -79,7 +87,7 @@ public class StrBuilderTest {
         assertEquals(3, sb7.size());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testChaining() {
         final StrBuilder sb = new StrBuilder();
@@ -94,7 +102,7 @@ public class StrBuilderTest {
         assertSame(sb, sb.trim());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReadFromReader() throws Exception {
         String s = "";
@@ -162,7 +170,7 @@ public class StrBuilderTest {
 
         private final CharBuffer src;
 
-        public MockReadable(final String src) {
+        MockReadable(final String src) {
             this.src = CharBuffer.wrap(src);
         }
 
@@ -172,7 +180,7 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testGetSetNewLineText() {
         final StrBuilder sb = new StrBuilder();
@@ -188,7 +196,7 @@ public class StrBuilderTest {
         assertNull(sb.getNewLineText());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testGetSetNullText() {
         final StrBuilder sb = new StrBuilder();
@@ -207,7 +215,7 @@ public class StrBuilderTest {
         assertNull(sb.getNullText());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testCapacityAndLength() {
         final StrBuilder sb = new StrBuilder();
@@ -292,12 +300,12 @@ public class StrBuilderTest {
         assertTrue(sb.isEmpty());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testLength() {
         final StrBuilder sb = new StrBuilder();
         assertEquals(0, sb.length());
-        
+
         sb.append("Hello");
         assertEquals(5, sb.length());
     }
@@ -306,11 +314,11 @@ public class StrBuilderTest {
     public void testSetLength() {
         final StrBuilder sb = new StrBuilder();
         sb.append("Hello");
-        sb.setLength(2);  // shorten
+        sb.setLength(2); // shorten
         assertEquals("He", sb.toString());
-        sb.setLength(2);  // no change
+        sb.setLength(2); // no change
         assertEquals("He", sb.toString());
-        sb.setLength(3);  // lengthen
+        sb.setLength(3); // lengthen
         assertEquals("He\0", sb.toString());
 
         try {
@@ -321,12 +329,12 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testCapacity() {
         final StrBuilder sb = new StrBuilder();
         assertEquals(sb.buffer.length, sb.capacity());
-        
+
         sb.append("HelloWorldHelloWorldHelloWorldHelloWorld");
         assertEquals(sb.buffer.length, sb.capacity());
     }
@@ -336,10 +344,10 @@ public class StrBuilderTest {
         final StrBuilder sb = new StrBuilder();
         sb.ensureCapacity(2);
         assertTrue(sb.capacity() >= 2);
-        
+
         sb.ensureCapacity(-1);
         assertTrue(sb.capacity() >= 0);
-        
+
         sb.append("HelloWorld");
         sb.ensureCapacity(40);
         assertTrue(sb.capacity() >= 40);
@@ -350,18 +358,18 @@ public class StrBuilderTest {
         final StrBuilder sb = new StrBuilder();
         sb.minimizeCapacity();
         assertEquals(0, sb.capacity());
-        
+
         sb.append("HelloWorld");
         sb.minimizeCapacity();
         assertEquals(10, sb.capacity());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testSize() {
         final StrBuilder sb = new StrBuilder();
         assertEquals(0, sb.size());
-        
+
         sb.append("Hello");
         assertEquals(5, sb.size());
     }
@@ -370,10 +378,10 @@ public class StrBuilderTest {
     public void testIsEmpty() {
         final StrBuilder sb = new StrBuilder();
         assertTrue(sb.isEmpty());
-        
+
         sb.append("Hello");
         assertFalse(sb.isEmpty());
-        
+
         sb.clear();
         assertTrue(sb.isEmpty());
     }
@@ -387,7 +395,7 @@ public class StrBuilderTest {
         assertTrue(sb.buffer.length >= 5);
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testCharAt() {
         final StrBuilder sb = new StrBuilder();
@@ -421,7 +429,7 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testSetCharAt() {
         final StrBuilder sb = new StrBuilder();
@@ -450,13 +458,13 @@ public class StrBuilderTest {
         assertEquals("bar", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testDeleteCharAt() {
         final StrBuilder sb = new StrBuilder("abc");
         sb.deleteCharAt(0);
-        assertEquals("bc", sb.toString()); 
-        
+        assertEquals("bc", sb.toString());
+
         try {
             sb.deleteCharAt(1000);
             fail("Expected IndexOutOfBoundsException");
@@ -464,7 +472,7 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testToCharArray() {
         final StrBuilder sb = new StrBuilder();
@@ -517,26 +525,26 @@ public class StrBuilderTest {
     @Test
     public void testGetChars() {
         final StrBuilder sb = new StrBuilder();
-        
+
         char[] input = new char[10];
         char[] a = sb.getChars(input);
         assertSame(input, a);
         assertTrue(Arrays.equals(new char[10], a));
-        
+
         sb.append("junit");
         a = sb.getChars(input);
         assertSame(input, a);
-        assertTrue(Arrays.equals(new char[]{'j', 'u', 'n', 'i', 't', 0, 0, 0, 0, 0}, a));
-        
+        assertTrue(Arrays.equals(new char[] {'j', 'u', 'n', 'i', 't', 0, 0, 0, 0, 0 }, a));
+
         a = sb.getChars(null);
         assertNotSame(input, a);
         assertEquals(5, a.length);
         assertTrue(Arrays.equals("junit".toCharArray(), a));
-        
+
         input = new char[5];
         a = sb.getChars(input);
         assertSame(input, a);
-        
+
         input = new char[4];
         a = sb.getChars(input);
         assertNotSame(input, a);
@@ -545,34 +553,34 @@ public class StrBuilderTest {
     @Test
     public void testGetCharsIntIntCharArrayInt() {
         final StrBuilder sb = new StrBuilder();
-               
+
         sb.append("junit");
         char[] a = new char[5];
         sb.getChars(0, 5, a, 0);
-        assertTrue(Arrays.equals(new char[]{'j', 'u', 'n', 'i', 't'}, a));
-        
+        assertTrue(Arrays.equals(new char[] {'j', 'u', 'n', 'i', 't' }, a));
+
         a = new char[5];
         sb.getChars(0, 2, a, 3);
-        assertTrue(Arrays.equals(new char[]{0, 0, 0, 'j', 'u'}, a));
-        
+        assertTrue(Arrays.equals(new char[] {0, 0, 0, 'j', 'u' }, a));
+
         try {
             sb.getChars(-1, 0, a, 0);
             fail("no exception");
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         try {
             sb.getChars(0, -1, a, 0);
             fail("no exception");
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         try {
             sb.getChars(0, 20, a, 0);
             fail("no exception");
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         try {
             sb.getChars(4, 2, a, 0);
             fail("no exception");
@@ -580,19 +588,19 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testDeleteIntInt() {
         StrBuilder sb = new StrBuilder("abc");
         sb.delete(0, 1);
-        assertEquals("bc", sb.toString()); 
+        assertEquals("bc", sb.toString());
         sb.delete(1, 2);
         assertEquals("b", sb.toString());
         sb.delete(0, 1);
-        assertEquals("", sb.toString()); 
+        assertEquals("", sb.toString());
         sb.delete(0, 1000);
-        assertEquals("", sb.toString()); 
-        
+        assertEquals("", sb.toString());
+
         try {
             sb.delete(1, 2);
             fail("Expected IndexOutOfBoundsException");
@@ -603,7 +611,7 @@ public class StrBuilderTest {
             fail("Expected IndexOutOfBoundsException");
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         sb = new StrBuilder("anything");
         try {
             sb.delete(2, 1);
@@ -612,7 +620,7 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testDeleteAll_char() {
         StrBuilder sb = new StrBuilder("abcbccba");
@@ -655,7 +663,7 @@ public class StrBuilderTest {
         assertEquals("abcbccba", sb.toString());
         sb.deleteAll("");
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.deleteAll("X");
         assertEquals("abcbccba", sb.toString());
         sb.deleteAll("a");
@@ -751,7 +759,7 @@ public class StrBuilderTest {
         assertEquals("btext", sb.toString());
         sb.replace(0, 1000, "text");
         assertEquals("text", sb.toString());
-        
+
         sb = new StrBuilder("atext");
         sb.replace(1, 1, "ny");
         assertEquals("anytext", sb.toString());
@@ -760,7 +768,7 @@ public class StrBuilderTest {
             fail("Expected IndexOutOfBoundsException");
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         sb = new StrBuilder();
         try {
             sb.replace(1, 2, "anything");
@@ -774,7 +782,7 @@ public class StrBuilderTest {
         }
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReplaceAll_char_char() {
         final StrBuilder sb = new StrBuilder("abcbccba");
@@ -790,7 +798,7 @@ public class StrBuilderTest {
         assertEquals("defeffed", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReplaceFirst_char_char() {
         final StrBuilder sb = new StrBuilder("abcbccba");
@@ -806,7 +814,7 @@ public class StrBuilderTest {
         assertEquals("defbccba", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReplaceAll_String_String() {
         StrBuilder sb = new StrBuilder("abcbccba");
@@ -818,7 +826,7 @@ public class StrBuilderTest {
         assertEquals("abcbccba", sb.toString());
         sb.replaceAll("", "anything");
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.replaceAll("x", "y");
         assertEquals("abcbccba", sb.toString());
         sb.replaceAll("a", "d");
@@ -827,11 +835,11 @@ public class StrBuilderTest {
         assertEquals("bcbccb", sb.toString());
         sb.replaceAll("cb", "-");
         assertEquals("b-c-", sb.toString());
-        
+
         sb = new StrBuilder("abcba");
         sb.replaceAll("b", "xbx");
         assertEquals("axbxcxbxa", sb.toString());
-        
+
         sb = new StrBuilder("bb");
         sb.replaceAll("b", "xbx");
         assertEquals("xbxxbx", sb.toString());
@@ -848,7 +856,7 @@ public class StrBuilderTest {
         assertEquals("abcbccba", sb.toString());
         sb.replaceFirst("", "anything");
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.replaceFirst("x", "y");
         assertEquals("abcbccba", sb.toString());
         sb.replaceFirst("a", "d");
@@ -857,17 +865,17 @@ public class StrBuilderTest {
         assertEquals("bcbccba", sb.toString());
         sb.replaceFirst("cb", "-");
         assertEquals("b-ccba", sb.toString());
-        
+
         sb = new StrBuilder("abcba");
         sb.replaceFirst("b", "xbx");
         assertEquals("axbxcba", sb.toString());
-        
+
         sb = new StrBuilder("bb");
         sb.replaceFirst("b", "xbx");
         assertEquals("xbxb", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReplaceAll_StrMatcher_String() {
         StrBuilder sb = new StrBuilder("abcbccba");
@@ -879,7 +887,7 @@ public class StrBuilderTest {
         assertEquals("abcbccba", sb.toString());
         sb.replaceAll(StrMatcher.noneMatcher(), "anything");
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.replaceAll(StrMatcher.charMatcher('x'), "y");
         assertEquals("abcbccba", sb.toString());
         sb.replaceAll(StrMatcher.charMatcher('a'), "d");
@@ -888,15 +896,15 @@ public class StrBuilderTest {
         assertEquals("bcbccb", sb.toString());
         sb.replaceAll(StrMatcher.stringMatcher("cb"), "-");
         assertEquals("b-c-", sb.toString());
-        
+
         sb = new StrBuilder("abcba");
         sb.replaceAll(StrMatcher.charMatcher('b'), "xbx");
         assertEquals("axbxcxbxa", sb.toString());
-        
+
         sb = new StrBuilder("bb");
         sb.replaceAll(StrMatcher.charMatcher('b'), "xbx");
         assertEquals("xbxxbx", sb.toString());
-        
+
         sb = new StrBuilder("A1-A2A3-A4");
         sb.replaceAll(A_NUMBER_MATCHER, "***");
         assertEquals("***-******-***", sb.toString());
@@ -917,7 +925,7 @@ public class StrBuilderTest {
         assertEquals("abcbccba", sb.toString());
         sb.replaceFirst(StrMatcher.noneMatcher(), "anything");
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.replaceFirst(StrMatcher.charMatcher('x'), "y");
         assertEquals("abcbccba", sb.toString());
         sb.replaceFirst(StrMatcher.charMatcher('a'), "d");
@@ -926,37 +934,37 @@ public class StrBuilderTest {
         assertEquals("bcbccba", sb.toString());
         sb.replaceFirst(StrMatcher.stringMatcher("cb"), "-");
         assertEquals("b-ccba", sb.toString());
-        
+
         sb = new StrBuilder("abcba");
         sb.replaceFirst(StrMatcher.charMatcher('b'), "xbx");
         assertEquals("axbxcba", sb.toString());
-        
+
         sb = new StrBuilder("bb");
         sb.replaceFirst(StrMatcher.charMatcher('b'), "xbx");
         assertEquals("xbxb", sb.toString());
-        
+
         sb = new StrBuilder("A1-A2A3-A4");
         sb.replaceFirst(A_NUMBER_MATCHER, "***");
         assertEquals("***-A2A3-A4", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReplace_StrMatcher_String_int_int_int_VaryMatcher() {
         StrBuilder sb = new StrBuilder("abcbccba");
         sb.replace((StrMatcher) null, "x", 0, sb.length(), -1);
         assertEquals("abcbccba", sb.toString());
-        
+
         sb.replace(StrMatcher.charMatcher('a'), "x", 0, sb.length(), -1);
         assertEquals("xbcbccbx", sb.toString());
-        
+
         sb.replace(StrMatcher.stringMatcher("cb"), "x", 0, sb.length(), -1);
         assertEquals("xbxcxx", sb.toString());
-        
+
         sb = new StrBuilder("A1-A2A3-A4");
         sb.replace(A_NUMBER_MATCHER, "***", 0, sb.length(), -1);
         assertEquals("***-******-***", sb.toString());
-        
+
         sb = new StrBuilder();
         sb.replace(A_NUMBER_MATCHER, "***", 0, sb.length(), -1);
         assertEquals("", sb.toString());
@@ -967,19 +975,19 @@ public class StrBuilderTest {
         StrBuilder sb = new StrBuilder("abcbccba");
         sb.replace(StrMatcher.stringMatcher("cb"), "cb", 0, sb.length(), -1);
         assertEquals("abcbccba", sb.toString());
-        
+
         sb = new StrBuilder("abcbccba");
         sb.replace(StrMatcher.stringMatcher("cb"), "-", 0, sb.length(), -1);
         assertEquals("ab-c-a", sb.toString());
-        
+
         sb = new StrBuilder("abcbccba");
         sb.replace(StrMatcher.stringMatcher("cb"), "+++", 0, sb.length(), -1);
         assertEquals("ab+++c+++a", sb.toString());
-        
+
         sb = new StrBuilder("abcbccba");
         sb.replace(StrMatcher.stringMatcher("cb"), "", 0, sb.length(), -1);
         assertEquals("abca", sb.toString());
-        
+
         sb = new StrBuilder("abcbccba");
         sb.replace(StrMatcher.stringMatcher("cb"), null, 0, sb.length(), -1);
         assertEquals("abca", sb.toString());
@@ -990,47 +998,47 @@ public class StrBuilderTest {
         StrBuilder sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, sb.length(), -1);
         assertEquals("-x--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 1, sb.length(), -1);
         assertEquals("aax--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 2, sb.length(), -1);
         assertEquals("aax--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 3, sb.length(), -1);
         assertEquals("aax--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 4, sb.length(), -1);
         assertEquals("aaxa-ay-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 5, sb.length(), -1);
         assertEquals("aaxaa-y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 6, sb.length(), -1);
         assertEquals("aaxaaaay-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 7, sb.length(), -1);
         assertEquals("aaxaaaay-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 8, sb.length(), -1);
         assertEquals("aaxaaaay-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 9, sb.length(), -1);
         assertEquals("aaxaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 10, sb.length(), -1);
         assertEquals("aaxaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         try {
             sb.replace(StrMatcher.stringMatcher("aa"), "-", 11, sb.length(), -1);
@@ -1038,7 +1046,7 @@ public class StrBuilderTest {
         } catch (final IndexOutOfBoundsException ex) {
         }
         assertEquals("aaxaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         try {
             sb.replace(StrMatcher.stringMatcher("aa"), "-", -1, sb.length(), -1);
@@ -1053,47 +1061,47 @@ public class StrBuilderTest {
         StrBuilder sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 0, -1);
         assertEquals("aaxaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 2, -1);
         assertEquals("-xaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 3, -1);
         assertEquals("-xaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 4, -1);
         assertEquals("-xaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 5, -1);
         assertEquals("-x-aayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 6, -1);
         assertEquals("-x-aayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 7, -1);
         assertEquals("-x--yaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 8, -1);
         assertEquals("-x--yaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 9, -1);
         assertEquals("-x--yaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, -1);
         assertEquals("-x--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 1000, -1);
         assertEquals("-x--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         try {
             sb.replace(StrMatcher.stringMatcher("aa"), "-", 2, 1, -1);
@@ -1108,66 +1116,66 @@ public class StrBuilderTest {
         StrBuilder sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, -1);
         assertEquals("-x--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 0);
         assertEquals("aaxaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 1);
         assertEquals("-xaaaayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 2);
         assertEquals("-x-aayaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 3);
         assertEquals("-x--yaa", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 4);
         assertEquals("-x--y-", sb.toString());
-        
+
         sb = new StrBuilder("aaxaaaayaa");
         sb.replace(StrMatcher.stringMatcher("aa"), "-", 0, 10, 5);
         assertEquals("-x--y-", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReverse() {
         final StrBuilder sb = new StrBuilder();
         assertEquals("", sb.reverse().toString());
-        
+
         sb.clear().append(true);
         assertEquals("eurt", sb.reverse().toString());
         assertEquals("true", sb.reverse().toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testTrim() {
         final StrBuilder sb = new StrBuilder();
         assertEquals("", sb.reverse().toString());
-        
+
         sb.clear().append(" \u0000 ");
         assertEquals("", sb.trim().toString());
-        
+
         sb.clear().append(" \u0000 a b c");
         assertEquals("a b c", sb.trim().toString());
-        
+
         sb.clear().append("a b c \u0000 ");
         assertEquals("a b c", sb.trim().toString());
-        
+
         sb.clear().append(" \u0000 a b c \u0000 ");
         assertEquals("a b c", sb.trim().toString());
-        
+
         sb.clear().append("a b c");
         assertEquals("a b c", sb.trim().toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testStartsWith() {
         final StrBuilder sb = new StrBuilder();
@@ -1198,7 +1206,7 @@ public class StrBuilderTest {
         assertFalse(sb.endsWith("abc "));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testSubSequenceIntInt() {
         final StrBuilder sb = new StrBuilder("hello goodbye");
@@ -1208,28 +1216,28 @@ public class StrBuilderTest {
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         // End index is negative
         try {
             sb.subSequence(2, -1);
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         // End index greater than length()
         try {
             sb.subSequence(2, sb.length() + 1);
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         // Start index greater then end index
         try {
             sb.subSequence(3, 2);
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         // Normal cases
         assertEquals("hello", sb.subSequence(0, 5));
         assertEquals("hello goodbye".subSequence(0, 6), sb.subSequence(0, 6));
@@ -1249,32 +1257,32 @@ public class StrBuilderTest {
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         try {
             sb.substring(15);
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-    
+
     }
-    
+
     @Test
     public void testSubstringIntInt() {
         final StrBuilder sb = new StrBuilder("hello goodbye");
         assertEquals("hello", sb.substring(0, 5));
         assertEquals("hello goodbye".substring(0, 6), sb.substring(0, 6));
-        
+
         assertEquals("goodbye", sb.substring(6, 13));
         assertEquals("hello goodbye".substring(6, 13), sb.substring(6, 13));
-        
+
         assertEquals("goodbye", sb.substring(6, 20));
-        
+
         try {
             sb.substring(-1, 5);
             fail();
         } catch (final IndexOutOfBoundsException e) {
         }
-        
+
         try {
             sb.substring(15, 20);
             fail();
@@ -1352,7 +1360,7 @@ public class StrBuilderTest {
     public void testIndexOf_char() {
         final StrBuilder sb = new StrBuilder("abab");
         assertEquals(0, sb.indexOf('a'));
-        
+
         // should work like String#indexOf
         assertEquals("abab".indexOf('a'), sb.indexOf('a'));
 
@@ -1387,14 +1395,14 @@ public class StrBuilderTest {
     @Test
     public void testLastIndexOf_char() {
         final StrBuilder sb = new StrBuilder("abab");
-        
+
         assertEquals(2, sb.lastIndexOf('a'));
-        //should work like String#lastIndexOf
+        // should work like String#lastIndexOf
         assertEquals("abab".lastIndexOf('a'), sb.lastIndexOf('a'));
-        
+
         assertEquals(3, sb.lastIndexOf('b'));
         assertEquals("abab".lastIndexOf('b'), sb.lastIndexOf('b'));
-        
+
         assertEquals(-1, sb.lastIndexOf('z'));
     }
 
@@ -1422,23 +1430,23 @@ public class StrBuilderTest {
     @Test
     public void testIndexOf_String() {
         final StrBuilder sb = new StrBuilder("abab");
-        
+
         assertEquals(0, sb.indexOf("a"));
-        //should work like String#indexOf
+        // should work like String#indexOf
         assertEquals("abab".indexOf("a"), sb.indexOf("a"));
-        
+
         assertEquals(0, sb.indexOf("ab"));
-        //should work like String#indexOf
+        // should work like String#indexOf
         assertEquals("abab".indexOf("ab"), sb.indexOf("ab"));
-        
+
         assertEquals(1, sb.indexOf("b"));
         assertEquals("abab".indexOf("b"), sb.indexOf("b"));
-        
+
         assertEquals(1, sb.indexOf("ba"));
         assertEquals("abab".indexOf("ba"), sb.indexOf("ba"));
-        
+
         assertEquals(-1, sb.indexOf("z"));
-        
+
         assertEquals(-1, sb.indexOf((String) null));
     }
 
@@ -1452,53 +1460,53 @@ public class StrBuilderTest {
         assertEquals(-1, sb.indexOf("a", 3));
         assertEquals(-1, sb.indexOf("a", 4));
         assertEquals(-1, sb.indexOf("a", 5));
-        
+
         assertEquals(-1, sb.indexOf("abcdef", 0));
         assertEquals(0, sb.indexOf("", 0));
         assertEquals(1, sb.indexOf("", 1));
-        
-        //should work like String#indexOf
+
+        // should work like String#indexOf
         assertEquals("abab".indexOf("a", 1), sb.indexOf("a", 1));
-        
+
         assertEquals(2, sb.indexOf("ab", 1));
-        //should work like String#indexOf
+        // should work like String#indexOf
         assertEquals("abab".indexOf("ab", 1), sb.indexOf("ab", 1));
-        
+
         assertEquals(3, sb.indexOf("b", 2));
         assertEquals("abab".indexOf("b", 2), sb.indexOf("b", 2));
-        
+
         assertEquals(1, sb.indexOf("ba", 1));
         assertEquals("abab".indexOf("ba", 2), sb.indexOf("ba", 2));
-        
+
         assertEquals(-1, sb.indexOf("z", 2));
-        
+
         sb = new StrBuilder("xyzabc");
         assertEquals(2, sb.indexOf("za", 0));
         assertEquals(-1, sb.indexOf("za", 3));
-        
+
         assertEquals(-1, sb.indexOf((String) null, 2));
     }
 
     @Test
     public void testLastIndexOf_String() {
         final StrBuilder sb = new StrBuilder("abab");
-        
+
         assertEquals(2, sb.lastIndexOf("a"));
-        //should work like String#lastIndexOf
+        // should work like String#lastIndexOf
         assertEquals("abab".lastIndexOf("a"), sb.lastIndexOf("a"));
-        
+
         assertEquals(2, sb.lastIndexOf("ab"));
-        //should work like String#lastIndexOf
+        // should work like String#lastIndexOf
         assertEquals("abab".lastIndexOf("ab"), sb.lastIndexOf("ab"));
-        
+
         assertEquals(3, sb.lastIndexOf("b"));
         assertEquals("abab".lastIndexOf("b"), sb.lastIndexOf("b"));
-        
+
         assertEquals(1, sb.lastIndexOf("ba"));
         assertEquals("abab".lastIndexOf("ba"), sb.lastIndexOf("ba"));
-        
+
         assertEquals(-1, sb.lastIndexOf("z"));
-        
+
         assertEquals(-1, sb.lastIndexOf((String) null));
     }
 
@@ -1512,30 +1520,30 @@ public class StrBuilderTest {
         assertEquals(2, sb.lastIndexOf("a", 3));
         assertEquals(2, sb.lastIndexOf("a", 4));
         assertEquals(2, sb.lastIndexOf("a", 5));
-        
+
         assertEquals(-1, sb.lastIndexOf("abcdef", 3));
         assertEquals("abab".lastIndexOf("", 3), sb.lastIndexOf("", 3));
         assertEquals("abab".lastIndexOf("", 1), sb.lastIndexOf("", 1));
-        
-        //should work like String#lastIndexOf
+
+        // should work like String#lastIndexOf
         assertEquals("abab".lastIndexOf("a", 1), sb.lastIndexOf("a", 1));
-        
+
         assertEquals(0, sb.lastIndexOf("ab", 1));
-        //should work like String#lastIndexOf
+        // should work like String#lastIndexOf
         assertEquals("abab".lastIndexOf("ab", 1), sb.lastIndexOf("ab", 1));
-        
+
         assertEquals(1, sb.lastIndexOf("b", 2));
         assertEquals("abab".lastIndexOf("b", 2), sb.lastIndexOf("b", 2));
-        
+
         assertEquals(1, sb.lastIndexOf("ba", 2));
         assertEquals("abab".lastIndexOf("ba", 2), sb.lastIndexOf("ba", 2));
-        
+
         assertEquals(-1, sb.lastIndexOf("z", 2));
-        
+
         sb = new StrBuilder("xyzabc");
         assertEquals(2, sb.lastIndexOf("za", sb.length()));
         assertEquals(-1, sb.lastIndexOf("za", 1));
-        
+
         assertEquals(-1, sb.lastIndexOf((String) null, 2));
     }
 
@@ -1545,7 +1553,7 @@ public class StrBuilderTest {
         final StrBuilder sb = new StrBuilder();
         assertEquals(-1, sb.indexOf((StrMatcher) null));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('a')));
-        
+
         sb.append("ab bd");
         assertEquals(0, sb.indexOf(StrMatcher.charMatcher('a')));
         assertEquals(1, sb.indexOf(StrMatcher.charMatcher('b')));
@@ -1553,7 +1561,7 @@ public class StrBuilderTest {
         assertEquals(4, sb.indexOf(StrMatcher.charMatcher('d')));
         assertEquals(-1, sb.indexOf(StrMatcher.noneMatcher()));
         assertEquals(-1, sb.indexOf((StrMatcher) null));
-        
+
         sb.append(" A1 junction");
         assertEquals(6, sb.indexOf(A_NUMBER_MATCHER));
     }
@@ -1564,13 +1572,13 @@ public class StrBuilderTest {
         assertEquals(-1, sb.indexOf((StrMatcher) null, 2));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('a'), 2));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('a'), 0));
-        
+
         sb.append("ab bd");
         assertEquals(0, sb.indexOf(StrMatcher.charMatcher('a'), -2));
         assertEquals(0, sb.indexOf(StrMatcher.charMatcher('a'), 0));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('a'), 2));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('a'), 20));
-        
+
         assertEquals(1, sb.indexOf(StrMatcher.charMatcher('b'), -1));
         assertEquals(1, sb.indexOf(StrMatcher.charMatcher('b'), 0));
         assertEquals(1, sb.indexOf(StrMatcher.charMatcher('b'), 1));
@@ -1579,16 +1587,16 @@ public class StrBuilderTest {
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('b'), 4));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('b'), 5));
         assertEquals(-1, sb.indexOf(StrMatcher.charMatcher('b'), 6));
-        
+
         assertEquals(2, sb.indexOf(StrMatcher.spaceMatcher(), -2));
         assertEquals(2, sb.indexOf(StrMatcher.spaceMatcher(), 0));
         assertEquals(2, sb.indexOf(StrMatcher.spaceMatcher(), 2));
         assertEquals(-1, sb.indexOf(StrMatcher.spaceMatcher(), 4));
         assertEquals(-1, sb.indexOf(StrMatcher.spaceMatcher(), 20));
-        
+
         assertEquals(-1, sb.indexOf(StrMatcher.noneMatcher(), 0));
         assertEquals(-1, sb.indexOf((StrMatcher) null, 0));
-        
+
         sb.append(" A1 junction with A2");
         assertEquals(6, sb.indexOf(A_NUMBER_MATCHER, 5));
         assertEquals(6, sb.indexOf(A_NUMBER_MATCHER, 6));
@@ -1603,7 +1611,7 @@ public class StrBuilderTest {
         final StrBuilder sb = new StrBuilder();
         assertEquals(-1, sb.lastIndexOf((StrMatcher) null));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('a')));
-        
+
         sb.append("ab bd");
         assertEquals(0, sb.lastIndexOf(StrMatcher.charMatcher('a')));
         assertEquals(3, sb.lastIndexOf(StrMatcher.charMatcher('b')));
@@ -1611,7 +1619,7 @@ public class StrBuilderTest {
         assertEquals(4, sb.lastIndexOf(StrMatcher.charMatcher('d')));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.noneMatcher()));
         assertEquals(-1, sb.lastIndexOf((StrMatcher) null));
-        
+
         sb.append(" A1 junction");
         assertEquals(6, sb.lastIndexOf(A_NUMBER_MATCHER));
     }
@@ -1623,13 +1631,13 @@ public class StrBuilderTest {
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('a'), 2));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('a'), 0));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('a'), -1));
-        
+
         sb.append("ab bd");
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('a'), -2));
         assertEquals(0, sb.lastIndexOf(StrMatcher.charMatcher('a'), 0));
         assertEquals(0, sb.lastIndexOf(StrMatcher.charMatcher('a'), 2));
         assertEquals(0, sb.lastIndexOf(StrMatcher.charMatcher('a'), 20));
-        
+
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('b'), -1));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.charMatcher('b'), 0));
         assertEquals(1, sb.lastIndexOf(StrMatcher.charMatcher('b'), 1));
@@ -1638,26 +1646,31 @@ public class StrBuilderTest {
         assertEquals(3, sb.lastIndexOf(StrMatcher.charMatcher('b'), 4));
         assertEquals(3, sb.lastIndexOf(StrMatcher.charMatcher('b'), 5));
         assertEquals(3, sb.lastIndexOf(StrMatcher.charMatcher('b'), 6));
-        
+
         assertEquals(-1, sb.lastIndexOf(StrMatcher.spaceMatcher(), -2));
         assertEquals(-1, sb.lastIndexOf(StrMatcher.spaceMatcher(), 0));
         assertEquals(2, sb.lastIndexOf(StrMatcher.spaceMatcher(), 2));
         assertEquals(2, sb.lastIndexOf(StrMatcher.spaceMatcher(), 4));
         assertEquals(2, sb.lastIndexOf(StrMatcher.spaceMatcher(), 20));
-        
+
         assertEquals(-1, sb.lastIndexOf(StrMatcher.noneMatcher(), 0));
         assertEquals(-1, sb.lastIndexOf((StrMatcher) null, 0));
-        
+
         sb.append(" A1 junction with A2");
         assertEquals(-1, sb.lastIndexOf(A_NUMBER_MATCHER, 5));
-        assertEquals(-1, sb.lastIndexOf(A_NUMBER_MATCHER, 6)); // A matches, 1 is outside bounds
+        assertEquals(-1, sb.lastIndexOf(A_NUMBER_MATCHER, 6)); // A matches, 1
+                                                               // is outside
+                                                               // bounds
         assertEquals(6, sb.lastIndexOf(A_NUMBER_MATCHER, 7));
         assertEquals(6, sb.lastIndexOf(A_NUMBER_MATCHER, 22));
-        assertEquals(6, sb.lastIndexOf(A_NUMBER_MATCHER, 23)); // A matches, 2 is outside bounds
+        assertEquals(6, sb.lastIndexOf(A_NUMBER_MATCHER, 23)); // A matches, 2
+                                                               // is outside
+                                                               // bounds
         assertEquals(23, sb.lastIndexOf(A_NUMBER_MATCHER, 24));
     }
 
     static final StrMatcher A_NUMBER_MATCHER = new StrMatcher() {
+
         @Override
         public int isMatch(final char[] buffer, int pos, final int bufferStart, final int bufferEnd) {
             if (buffer[pos] == 'A') {
@@ -1670,20 +1683,20 @@ public class StrBuilderTest {
         }
     };
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testAsTokenizer() throws Exception {
         // from Javadoc
         final StrBuilder b = new StrBuilder();
         b.append("a b ");
         final StrTokenizer t = b.asTokenizer();
-        
+
         final String[] tokens1 = t.getTokenArray();
         assertEquals(2, tokens1.length);
         assertEquals("a", tokens1[0]);
         assertEquals("b", tokens1[1]);
         assertEquals(2, t.size());
-        
+
         b.append("c d ");
         final String[] tokens2 = t.getTokenArray();
         assertEquals(2, tokens2.length);
@@ -1692,7 +1705,7 @@ public class StrBuilderTest {
         assertEquals(2, t.size());
         assertEquals("a", t.next());
         assertEquals("b", t.next());
-        
+
         t.reset();
         final String[] tokens3 = t.getTokenArray();
         assertEquals(4, tokens3.length);
@@ -1705,7 +1718,7 @@ public class StrBuilderTest {
         assertEquals("b", t.next());
         assertEquals("c", t.next());
         assertEquals("d", t.next());
-        
+
         assertEquals("a b c d ", t.getContent());
     }
 
@@ -1718,12 +1731,12 @@ public class StrBuilderTest {
         final char[] buf = new char[40];
         assertEquals(9, reader.read(buf));
         assertEquals("some text", new String(buf, 0, 9));
-        
+
         assertEquals(-1, reader.read());
         assertFalse(reader.ready());
         assertEquals(0, reader.skip(2));
         assertEquals(0, reader.skip(-1));
-        
+
         assertTrue(reader.markSupported());
         reader = sb.asReader();
         assertEquals('s', reader.read());
@@ -1740,11 +1753,11 @@ public class StrBuilderTest {
         assertEquals('e', array[2]);
         assertEquals(2, reader.skip(2));
         assertEquals(' ', reader.read());
-        
+
         assertTrue(reader.ready());
         reader.close();
         assertTrue(reader.ready());
-        
+
         reader = sb.asReader();
         array = new char[3];
         try {
@@ -1772,56 +1785,56 @@ public class StrBuilderTest {
             fail();
         } catch (final IndexOutOfBoundsException ex) {
         }
-        
+
         assertEquals(0, reader.read(array, 0, 0));
         assertEquals(0, array[0]);
         assertEquals(0, array[1]);
         assertEquals(0, array[2]);
-        
+
         reader.skip(9);
         assertEquals(-1, reader.read(array, 0, 1));
-        
+
         reader.reset();
         array = new char[30];
         assertEquals(9, reader.read(array, 0, 30));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testAsWriter() throws Exception {
         final StrBuilder sb = new StrBuilder("base");
         final Writer writer = sb.asWriter();
-        
+
         writer.write('l');
         assertEquals("basel", sb.toString());
-        
-        writer.write(new char[]{'i', 'n'});
+
+        writer.write(new char[] {'i', 'n' });
         assertEquals("baselin", sb.toString());
-        
-        writer.write(new char[]{'n', 'e', 'r'}, 1, 2);
+
+        writer.write(new char[] {'n', 'e', 'r' }, 1, 2);
         assertEquals("baseliner", sb.toString());
-        
+
         writer.write(" rout");
         assertEquals("baseliner rout", sb.toString());
-        
+
         writer.write("ping that server", 1, 3);
         assertEquals("baseliner routing", sb.toString());
-        
-        writer.flush();  // no effect
+
+        writer.flush(); // no effect
         assertEquals("baseliner routing", sb.toString());
-        
-        writer.close();  // no effect
+
+        writer.close(); // no effect
         assertEquals("baseliner routing", sb.toString());
-        
-        writer.write(" hi");  // works after close
+
+        writer.write(" hi"); // works after close
         assertEquals("baseliner routing hi", sb.toString());
-        
-        sb.setLength(4);  // mix and match
+
+        sb.setLength(4); // mix and match
         writer.write('d');
         assertEquals("based", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testEqualsIgnoreCase() {
         final StrBuilder sb1 = new StrBuilder();
@@ -1829,23 +1842,23 @@ public class StrBuilderTest {
         assertTrue(sb1.equalsIgnoreCase(sb1));
         assertTrue(sb1.equalsIgnoreCase(sb2));
         assertTrue(sb2.equalsIgnoreCase(sb2));
-        
+
         sb1.append("abc");
         assertFalse(sb1.equalsIgnoreCase(sb2));
-        
+
         sb2.append("ABC");
         assertTrue(sb1.equalsIgnoreCase(sb2));
-        
+
         sb2.clear().append("abc");
         assertTrue(sb1.equalsIgnoreCase(sb2));
         assertTrue(sb1.equalsIgnoreCase(sb1));
         assertTrue(sb2.equalsIgnoreCase(sb2));
-        
+
         sb2.clear().append("aBc");
         assertTrue(sb1.equalsIgnoreCase(sb2));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testEquals() {
         final StrBuilder sb1 = new StrBuilder();
@@ -1854,19 +1867,19 @@ public class StrBuilderTest {
         assertTrue(sb1.equals(sb1));
         assertTrue(sb2.equals(sb2));
         assertTrue(sb1.equals((Object) sb2));
-        
+
         sb1.append("abc");
         assertFalse(sb1.equals(sb2));
         assertFalse(sb1.equals((Object) sb2));
-        
+
         sb2.append("ABC");
         assertFalse(sb1.equals(sb2));
         assertFalse(sb1.equals((Object) sb2));
-        
+
         sb2.clear().append("abc");
         assertTrue(sb1.equals(sb2));
         assertTrue(sb1.equals((Object) sb2));
-        
+
         assertFalse(sb1.equals(Integer.valueOf(1)));
         assertFalse(sb1.equals("abc"));
     }
@@ -1878,7 +1891,7 @@ public class StrBuilderTest {
         assertFalse(sb.equals(other));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testHashCode() {
         final StrBuilder sb = new StrBuilder();
@@ -1886,7 +1899,7 @@ public class StrBuilderTest {
         final int hc1b = sb.hashCode();
         assertEquals(0, hc1a);
         assertEquals(hc1a, hc1b);
-        
+
         sb.append("abc");
         final int hc2a = sb.hashCode();
         final int hc2b = sb.hashCode();
@@ -1894,39 +1907,39 @@ public class StrBuilderTest {
         assertEquals(hc2a, hc2b);
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testToString() {
         final StrBuilder sb = new StrBuilder("abc");
         assertEquals("abc", sb.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testToStringBuffer() {
         final StrBuilder sb = new StrBuilder();
         assertEquals(new StringBuffer().toString(), sb.toStringBuffer().toString());
-        
+
         sb.append("junit");
         assertEquals(new StringBuffer("junit").toString(), sb.toStringBuffer().toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testToStringBuilder() {
         final StrBuilder sb = new StrBuilder();
         assertEquals(new StringBuilder().toString(), sb.toStringBuilder().toString());
-        
+
         sb.append("junit");
         assertEquals(new StringBuilder("junit").toString(), sb.toStringBuilder().toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testLang294() {
         final StrBuilder sb = new StrBuilder("\n%BLAH%\nDo more stuff\neven more stuff\n%BLAH%\n");
         sb.deleteAll("\n%BLAH%");
-        assertEquals("\nDo more stuff\neven more stuff\n", sb.toString()); 
+        assertEquals("\nDo more stuff\neven more stuff\n", sb.toString());
     }
 
     @Test
@@ -1936,7 +1949,7 @@ public class StrBuilderTest {
         assertEquals(-1, sb.indexOf("three"));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testLang295() {
         final StrBuilder sb = new StrBuilder("onetwothree");
@@ -1945,7 +1958,7 @@ public class StrBuilderTest {
         assertEquals("The indexOf(char) method is looking beyond the end of the string", -1, sb.indexOf('h'));
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testLang412Right() {
         final StrBuilder sb = new StrBuilder();
@@ -1966,7 +1979,7 @@ public class StrBuilderTest {
         assertEquals(sb.toString(), sb.build());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testAppendCharBuffer() {
         final StrBuilder sb1 = new StrBuilder();
@@ -1981,7 +1994,7 @@ public class StrBuilderTest {
         assertEquals("12345678", sb2.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testAppendToWriter() throws Exception {
         final StrBuilder sb = new StrBuilder("1234567890");
@@ -2106,8 +2119,8 @@ public class StrBuilderTest {
         assertEquals("c" + System.lineSeparator(), sb1.appendln(ch).toString());
     }
 
-    @Test(expected=StringIndexOutOfBoundsException.class)
-    public void testAppendTakingTwoAndThreeIntsWithZeroAndAppendTakingTwoAndThreeIntsThrowsStringIndexOutOfBoundsExceptionTwo() {
+    @Test(expected = StringIndexOutOfBoundsException.class)
+    public void testAppendTakingTwoIntsWithZeroThrowsStringIndexOutOfBoundsException() {
         final Charset charset = Charset.defaultCharset();
         final ByteBuffer byteBuffer = charset.encode("end < start");
         final CharBuffer charBuffer = charset.decode(byteBuffer);
@@ -2115,8 +2128,8 @@ public class StrBuilderTest {
         new StrBuilder(630).append(charBuffer, 0, 630);
     }
 
-    @Test(expected=StringIndexOutOfBoundsException.class)
-    public void testAppendTakingTwoAndThreeIntsThrowsStringIndexOutOfBoundsExceptionAndAppendTakingTwoAndThreeIntsThree() {
+    @Test(expected = StringIndexOutOfBoundsException.class)
+    public void testAppendTakingTwoIntsWithIndexOutOfBoundsThrowsStringIndexOutOfBoundsExceptionTwo() {
         final Charset charset = Charset.defaultCharset();
         final ByteBuffer byteBuffer = charset.encode("asdf");
         final CharBuffer charBuffer = charset.decode(byteBuffer);
@@ -2124,7 +2137,7 @@ public class StrBuilderTest {
         new StrBuilder().append(charBuffer, 933, 654);
     }
 
-    @Test(expected=StringIndexOutOfBoundsException.class)
+    @Test(expected = StringIndexOutOfBoundsException.class)
     public void testDeleteCharAtWithNegative() {
         new StrBuilder().deleteCharAt((-1258));
     }

http://git-wip-us.apache.org/repos/asf/commons-text/blob/6665a020/src/test/java/org/apache/commons/text/StrMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/StrMatcherTest.java b/src/test/java/org/apache/commons/text/StrMatcherTest.java
index 2b365e0..a233794 100644
--- a/src/test/java/org/apache/commons/text/StrMatcherTest.java
+++ b/src/test/java/org/apache/commons/text/StrMatcherTest.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/commons-text/blob/6665a020/src/test/java/org/apache/commons/text/StrSubstitutorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/StrSubstitutorTest.java b/src/test/java/org/apache/commons/text/StrSubstitutorTest.java
index 5f8b330..24c24a6 100644
--- a/src/test/java/org/apache/commons/text/StrSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StrSubstitutorTest.java
@@ -100,7 +100,8 @@ public class StrSubstitutorTest {
     public void testReplaceChangedMap() {
         final StrSubstitutor sub = new StrSubstitutor(values);
         values.put("target", "moon");
-        assertEquals("The quick brown fox jumps over the moon.", sub.replace("The ${animal} jumps over the ${target}."));
+        assertEquals("The quick brown fox jumps over the moon.",
+                sub.replace("The ${animal} jumps over the ${target}."));
     }
 
     /**
@@ -109,7 +110,8 @@ public class StrSubstitutorTest {
     @Test
     public void testReplaceUnknownKey() {
         doTestReplace("The ${person} jumps over the lazy dog.", "The ${person} jumps over the ${target}.", true);
-        doTestReplace("The ${person} jumps over the lazy dog. 1234567890.", "The ${person} jumps over the ${target}. ${undefined.number:-1234567890}.", true);
+        doTestReplace("The ${person} jumps over the lazy dog. 1234567890.",
+                "The ${person} jumps over the ${target}. ${undefined.number:-1234567890}.", true);
     }
 
     /**
@@ -165,7 +167,7 @@ public class StrSubstitutorTest {
         values.put("critterSpeed", "quick");
         values.put("critterColor", "brown");
         values.put("critterType", "fox");
-        doTestReplace(sub,"The ${critter} jumps over the ${pet}.", "The ${animal} jumps over the ${target}.", true);
+        doTestReplace(sub, "The ${critter} jumps over the ${pet}.", "The ${animal} jumps over the ${target}.", true);
     }
 
     /**
@@ -189,8 +191,10 @@ public class StrSubstitutorTest {
      */
     @Test
     public void testReplaceComplexEscaping() {
-        doTestReplace("The ${quick brown fox} jumps over the lazy dog.", "The $${${animal}} jumps over the ${target}.", true);
-        doTestReplace("The ${quick brown fox} jumps over the lazy dog. ${1234567890}.", "The $${${animal}} jumps over the ${target}. $${${undefined.number:-1234567890}}.", true);
+        doTestReplace("The ${quick brown fox} jumps over the lazy dog.",
+                "The $${${animal}} jumps over the ${target}.", true);
+        doTestReplace("The ${quick brown fox} jumps over the lazy dog. ${1234567890}.",
+                "The $${${animal}} jumps over the ${target}. $${${undefined.number:-1234567890}}.", true);
     }
 
     /**
@@ -214,7 +218,8 @@ public class StrSubstitutorTest {
      */
     @Test
     public void testReplacePrefixNoSuffix() {
-        doTestReplace("The ${animal jumps over the ${target} lazy dog.", "The ${animal jumps over the ${target} ${target}.", true);
+        doTestReplace("The ${animal jumps over the ${target} lazy dog.",
+                "The ${animal jumps over the ${target} ${target}.", true);
     }
 
     /**
@@ -333,7 +338,8 @@ public class StrSubstitutorTest {
         assertEquals(
                 "Wrong result (3)",
                 "The fox jumps over the lazy dog.",
-                sub.replace("The ${unknown.animal.${unknown.species:-1}:-fox} jumps over the ${unknow.target:-lazy dog}."));
+                sub.replace("The ${unknown.animal.${unknown.species:-1}:-fox} "
+                        + "jumps over the ${unknow.target:-lazy dog}."));
     }
 
     /**
@@ -421,7 +427,8 @@ public class StrSubstitutorTest {
         map.put("name", "commons");
         final StrSubstitutor sub = new StrSubstitutor(map) {
             @Override
-            protected String resolveVariable(final String variableName, final StrBuilder buf, final int startPos, final int endPos) {
+            protected String resolveVariable(final String variableName, final StrBuilder buf, final int startPos,
+                    final int endPos) {
                 assertEquals("name", variableName);
                 assertSame(builder, buf);
                 assertEquals(3, startPos);
@@ -618,7 +625,7 @@ public class StrSubstitutorTest {
      * Test the replace of a properties object
      */
     @Test
-    public void testSubstituteDefaultProperties(){
+    public void testSubstituteDefaultProperties() {
         final String org = "${doesnotwork}";
         System.setProperty("doesnotwork", "It works!");
 
@@ -659,7 +666,8 @@ public class StrSubstitutorTest {
     }
 
     //-----------------------------------------------------------------------
-    private void doTestReplace(final StrSubstitutor sub, final String expectedResult, final String replaceTemplate, final boolean substring) {
+    private void doTestReplace(final StrSubstitutor sub, final String expectedResult, final String replaceTemplate,
+            final boolean substring) {
         final String expectedShortResult = expectedResult.substring(1, expectedResult.length() - 1);
 
         // replace using String
@@ -759,9 +767,10 @@ public class StrSubstitutorTest {
     @Test
     public void testReplaceInTakingTwoAndThreeIntsReturningFalse() {
         final Map<String, Object> hashMap = new HashMap<>();
-        final StrLookup.MapStrLookup<Object> strLookup_MapStrLookup = new StrLookup.MapStrLookup<>(hashMap);
+        final StrLookup.MapStrLookup<Object> strLookupMapStrLookup = new StrLookup.MapStrLookup<>(hashMap);
         final StrMatcher strMatcher = StrMatcher.tabMatcher();
-        final StrSubstitutor strSubstitutor = new StrSubstitutor(strLookup_MapStrLookup, strMatcher, strMatcher, 'b', strMatcher);
+        final StrSubstitutor strSubstitutor =
+                new StrSubstitutor(strLookupMapStrLookup, strMatcher, strMatcher, 'b', strMatcher);
 
         assertFalse(strSubstitutor.replaceIn((StringBuilder) null, 1315, (-1369)));
         assertEquals('b', strSubstitutor.getEscapeChar());
@@ -780,7 +789,8 @@ public class StrSubstitutorTest {
 
     @Test
     public void testReplaceInTakingStringBufferWithNonNull() {
-        final StrSubstitutor strSubstitutor = new StrSubstitutor(new HashMap<String, String>(), "WV@i#y?N*[", "WV@i#y?N*[", '*');
+        final StrSubstitutor strSubstitutor =
+                new StrSubstitutor(new HashMap<String, String>(), "WV@i#y?N*[", "WV@i#y?N*[", '*');
 
         assertFalse(strSubstitutor.isPreserveEscapes());
         assertFalse(strSubstitutor.replaceIn(new StringBuffer("WV@i#y?N*[")));
@@ -790,8 +800,8 @@ public class StrSubstitutorTest {
     @Test
     public void testCreatesStrSubstitutorTakingStrLookupAndCallsReplaceTakingTwoAndThreeInts() {
         final Map<String, CharacterPredicates> map = new HashMap<>();
-        final StrLookup.MapStrLookup<CharacterPredicates> strLookup_MapStrLookup = new StrLookup.MapStrLookup<>(map);
-        final StrSubstitutor strSubstitutor = new StrSubstitutor(strLookup_MapStrLookup);
+        final StrLookup.MapStrLookup<CharacterPredicates> strLookupMapStrLookup = new StrLookup.MapStrLookup<>(map);
+        final StrSubstitutor strSubstitutor = new StrSubstitutor(strLookupMapStrLookup);
 
         assertNull(strSubstitutor.replace((CharSequence) null, 0, 0));
         assertEquals('$', strSubstitutor.getEscapeChar());
@@ -801,12 +811,12 @@ public class StrSubstitutorTest {
     public void testReplaceTakingCharSequenceReturningNull() {
         final StrSubstitutor strSubstitutor = new StrSubstitutor((StrLookup<?>) null);
 
-        assertNull( strSubstitutor.replace((CharSequence) null) );
+        assertNull(strSubstitutor.replace((CharSequence) null));
         assertFalse(strSubstitutor.isPreserveEscapes());
         assertEquals('$', strSubstitutor.getEscapeChar());
     }
 
-    @Test(expected=NullPointerException.class)
+    @Test(expected = NullPointerException.class)
     public void testReplaceTakingThreeArgumentsThrowsNullPointerException() {
         StrSubstitutor.replace(null, (Properties) null);
     }
@@ -819,4 +829,4 @@ public class StrSubstitutorTest {
         assertFalse(strSubstitutor.replaceIn((StringBuilder) null));
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/commons-text/blob/6665a020/src/test/java/org/apache/commons/text/StrTokenizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/text/StrTokenizerTest.java b/src/test/java/org/apache/commons/text/StrTokenizerTest.java
index 44d2524..63a6ec0 100644
--- a/src/test/java/org/apache/commons/text/StrTokenizerTest.java
+++ b/src/test/java/org/apache/commons/text/StrTokenizerTest.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,14 +17,18 @@
 
 package org.apache.commons.text;
 
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.NoSuchElementException;
 
-import static org.junit.Assert.*;
+import org.junit.Test;
 
 /**
  * Unit test for {@link StrTokenizer}.
@@ -50,9 +54,9 @@ public class StrTokenizerTest {
         tok.setQuoteChar('"');
         tok.setIgnoredMatcher(StrMatcher.trimMatcher());
         tok.setIgnoreEmptyTokens(false);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", "c", "d;\"e", "f", "", "", "",};
+        final String[] expected = {"a", "b", "c", "d;\"e", "f", "", "", ""};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -71,9 +75,9 @@ public class StrTokenizerTest {
         tok.setQuoteChar('"');
         tok.setIgnoredMatcher(StrMatcher.noneMatcher());
         tok.setIgnoreEmptyTokens(false);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", "c ", "d;\"e", "f", " ", " ", "",};
+        final String[] expected = {"a", "b", "c ", "d;\"e", "f", " ", " ", ""};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -92,9 +96,9 @@ public class StrTokenizerTest {
         tok.setQuoteChar('"');
         tok.setIgnoredMatcher(StrMatcher.noneMatcher());
         tok.setIgnoreEmptyTokens(false);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", " c", "d;\"e", "f", " ", " ", "",};
+        final String[] expected = {"a", "b", " c", "d;\"e", "f", " ", " ", ""};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -113,9 +117,9 @@ public class StrTokenizerTest {
         tok.setQuoteChar('"');
         tok.setIgnoredMatcher(StrMatcher.trimMatcher());
         tok.setIgnoreEmptyTokens(true);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", "c", "d;\"e", "f",};
+        final String[] expected = {"a", "b", "c", "d;\"e", "f"};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -135,9 +139,9 @@ public class StrTokenizerTest {
         tok.setIgnoredMatcher(StrMatcher.trimMatcher());
         tok.setIgnoreEmptyTokens(false);
         tok.setEmptyTokenAsNull(true);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", "c", "d;\"e", "f", null, null, null,};
+        final String[] expected = {"a", "b", "c", "d;\"e", "f", null, null, null};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -157,9 +161,9 @@ public class StrTokenizerTest {
         tok.setIgnoredMatcher(StrMatcher.trimMatcher());
         tok.setIgnoreEmptyTokens(false);
         // tok.setTreatingEmptyAsNull(true);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", " c", "d;\"e", "f", null, null, null,};
+        final String[] expected = {"a", "b", " c", "d;\"e", "f", null, null, null};
 
         int nextCount = 0;
         while (tok.hasNext()) {
@@ -192,9 +196,9 @@ public class StrTokenizerTest {
         tok.setQuoteMatcher(StrMatcher.doubleQuoteMatcher());
         tok.setIgnoredMatcher(StrMatcher.noneMatcher());
         tok.setIgnoreEmptyTokens(false);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "", "", "b", "c", "d e", "f", "",};
+        final String[] expected = {"a", "", "", "b", "c", "d e", "f", ""};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -213,9 +217,9 @@ public class StrTokenizerTest {
         tok.setQuoteMatcher(StrMatcher.doubleQuoteMatcher());
         tok.setIgnoredMatcher(StrMatcher.noneMatcher());
         tok.setIgnoreEmptyTokens(true);
-        final String tokens[] = tok.getTokenArray();
+        final String[] tokens = tok.getTokenArray();
 
-        final String expected[] = new String[]{"a", "b", "c", "d e", "f",};
+        final String[] expected = {"a", "b", "c", "d e", "f"};
 
         assertEquals(Arrays.toString(tokens), expected.length, tokens.length);
         for (int i = 0; i < expected.length; i++) {
@@ -307,7 +311,7 @@ public class StrTokenizerTest {
     @Test
     public void testDelimMatcher() {
         final String input = "a/b\\c";
-        final StrMatcher delimMatcher = new StrMatcher.CharSetMatcher(new char[]{'/', '\\'});
+        final StrMatcher delimMatcher = new StrMatcher.CharSetMatcher(new char[] {'/', '\\'});
 
         final StrTokenizer tok = new StrTokenizer(input, delimMatcher);
         assertEquals("a", tok.next());
@@ -319,8 +323,8 @@ public class StrTokenizerTest {
     @Test
     public void testDelimMatcherQuoteMatcher() {
         final String input = "`a`;`b`;`c`";
-        final StrMatcher delimMatcher = new StrMatcher.CharSetMatcher(new char[]{';'});
-        final StrMatcher quoteMatcher = new StrMatcher.CharSetMatcher(new char[]{'`'});
+        final StrMatcher delimMatcher = new StrMatcher.CharSetMatcher(new char[] {';'});
+        final StrMatcher quoteMatcher = new StrMatcher.CharSetMatcher(new char[] {'`'});
 
         final StrTokenizer tok = new StrTokenizer(input, delimMatcher, quoteMatcher);
         assertEquals("a", tok.next());
@@ -528,19 +532,19 @@ public class StrTokenizerTest {
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testListArray() {
         final String input = "a  b c";
         final StrTokenizer tok = new StrTokenizer(input);
         final String[] array = tok.getTokenArray();
         final List<?> list = tok.getTokenList();
-        
+
         assertEquals(Arrays.asList(array), list);
         assertEquals(3, list.size());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     private void testCSV(final String data) {
         this.testXSVAbc(StrTokenizer.getCSVInstance(data));
         this.testXSVAbc(StrTokenizer.getCSVInstance(data.toCharArray()));
@@ -573,7 +577,8 @@ public class StrTokenizerTest {
         try {
             tokenizer.next();
             fail();
-        } catch (final NoSuchElementException ex) {}
+        } catch (final NoSuchElementException ex) {
+        }
     }
 
     @Test
@@ -584,12 +589,12 @@ public class StrTokenizerTest {
 
         tok = new StrTokenizer(input.toCharArray());
         assertEquals(input, tok.getContent());
-        
+
         tok = new StrTokenizer();
         assertNull(tok.getContent());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testChaining() {
         final StrTokenizer tok = new StrTokenizer();
@@ -609,12 +614,13 @@ public class StrTokenizerTest {
     }
 
     /**
-     * Tests that the {@link StrTokenizer#clone()} clone method catches {@link CloneNotSupportedException} and returns
-     * <code>null</code>.
+     * Tests that the {@link StrTokenizer#clone()} clone method catches
+     * {@link CloneNotSupportedException} and returns <code>null</code>.
      */
     @Test
     public void testCloneNotSupportedException() {
         final Object notCloned = new StrTokenizer() {
+
             @Override
             Object cloneReset() throws CloneNotSupportedException {
                 throw new CloneNotSupportedException("test");
@@ -639,7 +645,7 @@ public class StrTokenizerTest {
 
     @Test
     public void testCloneReset() {
-        final char[] input = new char[]{'a'};
+        final char[] input = new char[] {'a'};
         final StrTokenizer tokenizer = new StrTokenizer(input);
         // Start sanity check
         assertEquals("a", tokenizer.nextToken());
@@ -652,7 +658,7 @@ public class StrTokenizerTest {
         assertEquals("b", tokenizer.nextToken());
         assertEquals("a", clonedTokenizer.nextToken());
     }
-  
+
     // -----------------------------------------------------------------------
     @Test
     public void testConstructor_String() {
@@ -660,15 +666,15 @@ public class StrTokenizerTest {
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer("");
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((String) null);
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructor_String_char() {
         StrTokenizer tok = new StrTokenizer("a b", ' ');
@@ -676,15 +682,15 @@ public class StrTokenizerTest {
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer("", ' ');
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((String) null, ' ');
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructor_String_char_char() {
         StrTokenizer tok = new StrTokenizer("a b", ' ', '"');
@@ -693,30 +699,30 @@ public class StrTokenizerTest {
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer("", ' ', '"');
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((String) null, ' ', '"');
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructor_charArray() {
         StrTokenizer tok = new StrTokenizer("a b".toCharArray());
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer(new char[0]);
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((char[]) null);
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructor_charArray_char() {
         StrTokenizer tok = new StrTokenizer("a b".toCharArray(), ' ');
@@ -724,15 +730,15 @@ public class StrTokenizerTest {
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer(new char[0], ' ');
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((char[]) null, ' ');
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testConstructor_charArray_char_char() {
         StrTokenizer tok = new StrTokenizer("a b".toCharArray(), ' ', '"');
@@ -741,15 +747,15 @@ public class StrTokenizerTest {
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer(new char[0], ' ', '"');
         assertFalse(tok.hasNext());
-        
+
         tok = new StrTokenizer((char[]) null, ' ', '"');
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReset() {
         final StrTokenizer tok = new StrTokenizer("a b c");
@@ -757,7 +763,7 @@ public class StrTokenizerTest {
         assertEquals("b", tok.next());
         assertEquals("c", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok.reset();
         assertEquals("a", tok.next());
         assertEquals("b", tok.next());
@@ -765,7 +771,7 @@ public class StrTokenizerTest {
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReset_String() {
         final StrTokenizer tok = new StrTokenizer("x x x");
@@ -773,26 +779,26 @@ public class StrTokenizerTest {
         assertEquals("d", tok.next());
         assertEquals("e", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok.reset((String) null);
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testReset_charArray() {
         final StrTokenizer tok = new StrTokenizer("x x x");
-        
+
         final char[] array = new char[] {'a', 'b', 'c'};
         tok.reset(array);
         assertEquals("abc", tok.next());
         assertFalse(tok.hasNext());
-        
+
         tok.reset((char[]) null);
         assertFalse(tok.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testTSV() {
         this.testXSVAbc(StrTokenizer.getTSVInstance(TSV_SIMPLE_FIXTURE));
@@ -837,45 +843,51 @@ public class StrTokenizerTest {
         try {
             tkn.previous();
             fail();
-        } catch (final NoSuchElementException ex) {}
+        } catch (final NoSuchElementException ex) {
+        }
         assertTrue(tkn.hasNext());
-        
+
         assertEquals("a", tkn.next());
         try {
             tkn.remove();
             fail();
-        } catch (final UnsupportedOperationException ex) {}
+        } catch (final UnsupportedOperationException ex) {
+        }
         try {
             tkn.set("x");
             fail();
-        } catch (final UnsupportedOperationException ex) {}
+        } catch (final UnsupportedOperationException ex) {
+        }
         try {
             tkn.add("y");
             fail();
-        } catch (final UnsupportedOperationException ex) {}
+        } catch (final UnsupportedOperationException ex) {
+        }
         assertTrue(tkn.hasPrevious());
         assertTrue(tkn.hasNext());
-        
+
         assertEquals("b", tkn.next());
         assertTrue(tkn.hasPrevious());
         assertTrue(tkn.hasNext());
-        
+
         assertEquals("c", tkn.next());
         assertTrue(tkn.hasPrevious());
         assertFalse(tkn.hasNext());
-        
+
         try {
             tkn.next();
             fail();
-        } catch (final NoSuchElementException ex) {}
+        } catch (final NoSuchElementException ex) {
+        }
         assertTrue(tkn.hasPrevious());
         assertFalse(tkn.hasNext());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testTokenizeSubclassInputChange() {
         final StrTokenizer tkn = new StrTokenizer("a b c d e") {
+
             @Override
             protected List<String> tokenize(final char[] chars, final int offset, final int count) {
                 return super.tokenize("w x y z".toCharArray(), 2, 5);
@@ -885,10 +897,11 @@ public class StrTokenizerTest {
         assertEquals("y", tkn.next());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testTokenizeSubclassOutputChange() {
         final StrTokenizer tkn = new StrTokenizer("a b c") {
+
             @Override
             protected List<String> tokenize(final char[] chars, final int offset, final int count) {
                 final List<String> list = super.tokenize(chars, offset, count);
@@ -901,7 +914,7 @@ public class StrTokenizerTest {
         assertEquals("a", tkn.next());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testToString() {
         final StrTokenizer tkn = new StrTokenizer("a b c d e");
@@ -910,29 +923,29 @@ public class StrTokenizerTest {
         assertEquals("StrTokenizer[a, b, c, d, e]", tkn.toString());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testStringTokenizerStringMatcher() {
-        final char chars[]=new char[]{'a', 'b', 'c', 'd'};
-        final StrTokenizer tokens= new StrTokenizer(chars, "bc");
+        final char[] chars = {'a', 'b', 'c', 'd'};
+        final StrTokenizer tokens = new StrTokenizer(chars, "bc");
         assertEquals("a", tokens.next());
         assertEquals("d", tokens.next());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testStringTokenizerStrMatcher() {
-        final char chars[]=new char[]{'a', ',', 'c'};
-        final StrTokenizer tokens= new StrTokenizer(chars, StrMatcher.commaMatcher());
+        final char[] chars = {'a', ',', 'c'};
+        final StrTokenizer tokens = new StrTokenizer(chars, StrMatcher.commaMatcher());
         assertEquals("a", tokens.next());
         assertEquals("c", tokens.next());
     }
 
-    //-----------------------------------------------------------------------
+    // -----------------------------------------------------------------------
     @Test
     public void testStringTokenizerQuoteMatcher() {
-        final char chars[]=new char[]{'\'','a', 'c','\'','d'};
-        final StrTokenizer tokens= new StrTokenizer(chars, StrMatcher.commaMatcher(), StrMatcher.quoteMatcher());
+        final char[] chars = {'\'', 'a', 'c', '\'', 'd'};
+        final StrTokenizer tokens = new StrTokenizer(chars, StrMatcher.commaMatcher(), StrMatcher.quoteMatcher());
         assertEquals("acd", tokens.next());
     }
 


Mime
View raw message