You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/29 11:56:59 UTC

[commons-text] 02/02: Fix up Checkstyle again

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git

commit 798517451a9a54f82508103721e80449086a7dce
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 29 07:55:48 2022 -0400

    Fix up Checkstyle again
---
 checkstyle-suppressions.xml                        |  4 +
 checkstyle.xml                                     |  2 +-
 .../apache/commons/text/AlphabetConverterTest.java | 95 +++++++++-------------
 .../commons/text/lookup/FileStringLookupTest.java  |  6 +-
 .../similarity/IntersectionSimilarityTest.java     | 36 ++++----
 5 files changed, 65 insertions(+), 78 deletions(-)

diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index d5715aeb..98a2b135 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -19,6 +19,10 @@
    limitations under the License.
 -->
 <suppressions>
+  <suppress checks="FileLength" files="StrBuilderTest.java" />
+  <suppress checks="FileLength" files="StrBuilder.java" />
+  <suppress checks="FileLength" files="TextStringBuilderTest.java" />
+  <suppress checks="FileLength" files="TextStringBuilder.java" />
   <suppress checks="MagicNumber" files="JaccardDistance.java" />
   <suppress checks="MagicNumber" files="JaccardSimilarity.java" />
   <suppress checks="MagicNumber" files="JaroWinklerDistance.java" />
diff --git a/checkstyle.xml b/checkstyle.xml
index 86324b0a..f0c3258d 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -85,7 +85,7 @@
     </module>
 
     <module name="LineLength">
-        <property name="max" value="120"/>
+        <property name="max" value="160"/>
     </module>
 
     <module name="TreeWalker">
diff --git a/src/test/java/org/apache/commons/text/AlphabetConverterTest.java b/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
index 63088378..431a4956 100644
--- a/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
+++ b/src/test/java/org/apache/commons/text/AlphabetConverterTest.java
@@ -34,31 +34,29 @@ import org.junit.jupiter.api.Test;
  */
 public class AlphabetConverterTest {
 
-    private static final Character[] LOWER_CASE_ENGLISH = {' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
-        'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
+    private static final Character[] LOWER_CASE_ENGLISH = {' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+        't', 'u', 'v', 'w', 'x', 'y', 'z'};
 
-    private static final Character[] ENGLISH_AND_NUMBERS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
-        'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
-        'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
-        'U', 'V', 'W', 'X', 'Y', 'Z', ' '};
+    private static final Character[] ENGLISH_AND_NUMBERS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+        'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+        'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '};
 
-    private static final Character[] LOWER_CASE_ENGLISH_AND_NUMBERS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
-        'w', 'x', 'y', 'z', ' '};
+    private static final Character[] LOWER_CASE_ENGLISH_AND_NUMBERS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+        'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ' '};
 
     private static final Character[] NUMBERS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
 
     private static final Character[] BINARY = {'0', '1'};
 
-    private static final Character[] HEBREW = {'_', ' ', '\u05e7', '\u05e8', '\u05d0', '\u05d8', '\u05d5', '\u05df',
-        '\u05dd', '\u05e4', '\u05e9', '\u05d3', '\u05d2', '\u05db', '\u05e2', '\u05d9', '\u05d7', '\u05dc', '\u05da',
-        '\u05e3', '\u05d6', '\u05e1', '\u05d1', '\u05d4', '\u05e0', '\u05de', '\u05e6', '\u05ea', '\u05e5'};
+    private static final Character[] HEBREW = {'_', ' ', '\u05e7', '\u05e8', '\u05d0', '\u05d8', '\u05d5', '\u05df', '\u05dd', '\u05e4', '\u05e9', '\u05d3',
+        '\u05d2', '\u05db', '\u05e2', '\u05d9', '\u05d7', '\u05dc', '\u05da', '\u05e3', '\u05d6', '\u05e1', '\u05d1', '\u05d4', '\u05e0', '\u05de', '\u05e6',
+        '\u05ea', '\u05e5'};
 
-    private static final Integer[] UNICODE = {32, 35395, 35397, 36302, 36291, 35203, 35201, 35215, 35219, 35268, 97, 98,
-        99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 1001, 1002, 1003, 1004, 1005};
+    private static final Integer[] UNICODE = {32, 35395, 35397, 36302, 36291, 35203, 35201, 35215, 35219, 35268, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+        107, 108, 109, 110, 1001, 1002, 1003, 1004, 1005};
 
-    private static final Integer[] LOWER_CASE_ENGLISH_CODEPOINTS = {32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
-        107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122};
+    private static final Integer[] LOWER_CASE_ENGLISH_CODEPOINTS = {32, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+        115, 116, 117, 118, 119, 120, 121, 122};
 
     private static final Integer[] DO_NOT_ENCODE_CODEPOINTS = {32, 97, 98, 99}; // space, a, b, c
 
@@ -79,15 +77,14 @@ public class AlphabetConverterTest {
 
     @Test
     public void doNotEncodeTest() throws UnsupportedEncodingException {
-        test(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH, "1", "456", "abc", "ABC",
-                "this will not be converted but THIS WILL");
-        test(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH_AND_NUMBERS, NUMBERS, "1", "456", "abc", "ABC",
-                "this will be converted but 12345 and this will be");
+        test(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH, "1", "456", "abc", "ABC", "this will not be converted but THIS WILL");
+        test(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH_AND_NUMBERS, NUMBERS, "1", "456", "abc", "ABC", "this will be converted but 12345 and this will be");
     }
 
     @Test
     public void encodeFailureTest() {
-        assertThatThrownBy(() -> test(BINARY, NUMBERS, ArrayUtils.EMPTY_CHARACTER_OBJECT_ARRAY, "3")).isInstanceOf(UnsupportedEncodingException.class).hasMessage("Couldn't find encoding for '3' in 3");
+        assertThatThrownBy(() -> test(BINARY, NUMBERS, ArrayUtils.EMPTY_CHARACTER_OBJECT_ARRAY, "3")).isInstanceOf(UnsupportedEncodingException.class)
+            .hasMessage("Couldn't find encoding for '3' in 3");
     }
 
     @Test
@@ -118,20 +115,20 @@ public class AlphabetConverterTest {
 
     @Test
     public void missingDoNotEncodeLettersFromEncodingTest() {
-        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH, NUMBERS)).isInstanceOf(IllegalArgumentException.class).hasMessage(
-                "Can not use 'do not encode' list because encoding alphabet does not contain '0'");
+        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(ENGLISH_AND_NUMBERS, LOWER_CASE_ENGLISH, NUMBERS))
+            .isInstanceOf(IllegalArgumentException.class).hasMessage("Can not use 'do not encode' list because encoding alphabet does not contain '0'");
     }
 
     @Test
     public void missingDoNotEncodeLettersFromOriginalTest() {
-        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(LOWER_CASE_ENGLISH, ENGLISH_AND_NUMBERS, NUMBERS)).isInstanceOf(IllegalArgumentException.class).hasMessage(
-                "Can not use 'do not encode' list because original alphabet does not contain '0'");
+        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(LOWER_CASE_ENGLISH, ENGLISH_AND_NUMBERS, NUMBERS))
+            .isInstanceOf(IllegalArgumentException.class).hasMessage("Can not use 'do not encode' list because original alphabet does not contain '0'");
     }
 
     @Test
     public void noEncodingLettersTest() {
-        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(ENGLISH_AND_NUMBERS, NUMBERS, NUMBERS)).isInstanceOf(IllegalArgumentException.class).hasMessage(
-            "Must have at least two encoding characters (excluding those in the 'do not encode' list), but has 0");
+        assertThatThrownBy(() -> AlphabetConverter.createConverterFromChars(ENGLISH_AND_NUMBERS, NUMBERS, NUMBERS)).isInstanceOf(IllegalArgumentException.class)
+            .hasMessage("Must have at least two encoding characters (excluding those in the 'do not encode' list), but has 0");
     }
 
     @Test
@@ -141,18 +138,16 @@ public class AlphabetConverterTest {
             numbersPlusUnderscore[numbersPlusUnderscore.length - 1] = '_';
 
             AlphabetConverter.createConverterFromChars(ENGLISH_AND_NUMBERS, numbersPlusUnderscore, NUMBERS);
-        }).isInstanceOf(IllegalArgumentException.class).hasMessage(
-            "Must have at least two encoding characters (excluding those in the 'do not encode' list), but has 1");
+        }).isInstanceOf(IllegalArgumentException.class)
+            .hasMessage("Must have at least two encoding characters (excluding those in the 'do not encode' list), but has 1");
     }
 
-    private void test(final Character[] originalChars, final Character[] encodingChars,
-            final Character[] doNotEncodeChars, final String... strings) throws UnsupportedEncodingException {
+    private void test(final Character[] originalChars, final Character[] encodingChars, final Character[] doNotEncodeChars, final String... strings)
+        throws UnsupportedEncodingException {
 
-        final AlphabetConverter ac = AlphabetConverter.createConverterFromChars(originalChars, encodingChars,
-                doNotEncodeChars);
+        final AlphabetConverter ac = AlphabetConverter.createConverterFromChars(originalChars, encodingChars, doNotEncodeChars);
 
-        final AlphabetConverter reconstructedAlphabetConverter = AlphabetConverter
-                .createConverterFromMap(ac.getOriginalToEncoded());
+        final AlphabetConverter reconstructedAlphabetConverter = AlphabetConverter.createConverterFromMap(ac.getOriginalToEncoded());
 
         assertThat(reconstructedAlphabetConverter).isEqualTo(ac);
         assertThat(reconstructedAlphabetConverter.hashCode()).isEqualTo(ac.hashCode());
@@ -178,8 +173,7 @@ public class AlphabetConverterTest {
                 assertThat(originalCharsList.contains(decoded.charAt(i))).isTrue();
             }
 
-            assertThat(decoded).as("Encoded '" + s + "' into '" + encoded + "', but decoded into '" + decoded + "'")
-                .isEqualTo(s);
+            assertThat(decoded).as("Encoded '" + s + "' into '" + encoded + "', but decoded into '" + decoded + "'").isEqualTo(s);
         }
     }
 
@@ -190,8 +184,7 @@ public class AlphabetConverterTest {
         final char character = '+';
         characterArray[0] = character;
         characterArray[1] = characterArray[0];
-        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray,
-                characterArray, characterArray);
+        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, characterArray, characterArray);
 
         assertThat(alphabetConverter.equals(charOne)).isFalse();
     }
@@ -201,8 +194,7 @@ public class AlphabetConverterTest {
         final Character[] characterArray = new Character[2];
         characterArray[0] = '5';
         characterArray[1] = characterArray[0];
-        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray,
-                characterArray, characterArray);
+        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, characterArray, characterArray);
 
         assertThat(alphabetConverter.getEncodedCharLength()).isEqualTo(1);
     }
@@ -244,8 +236,7 @@ public class AlphabetConverterTest {
         final char character = 'R';
         characterArray[0] = character;
         characterArray[1] = character;
-        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray,
-                characterArray, characterArray);
+        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, characterArray, characterArray);
         final Map<Integer, String> map = new HashMap<>();
         final AlphabetConverter alphabetConverterTwo = AlphabetConverter.createConverterFromMap(map);
 
@@ -256,8 +247,7 @@ public class AlphabetConverterTest {
     @Test
     public void testEqualsWithNull() {
         final Character[] characterArray = ArrayUtils.EMPTY_CHARACTER_OBJECT_ARRAY;
-        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, null,
-            null);
+        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, null, null);
 
         assertThat(alphabetConverter.equals(null)).isFalse();
     }
@@ -268,8 +258,7 @@ public class AlphabetConverterTest {
         final char character = 'R';
         characterArray[0] = character;
         characterArray[1] = character;
-        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray,
-                characterArray, characterArray);
+        final AlphabetConverter alphabetConverter = AlphabetConverter.createConverterFromChars(characterArray, characterArray, characterArray);
 
         assertThat(alphabetConverter.equals(alphabetConverter)).isTrue();
     }
@@ -280,8 +269,7 @@ public class AlphabetConverterTest {
         assertThatThrownBy(() -> {
             final AlphabetConverter ac = createJavadocExample();
             ac.decode(toDecode);
-        }).isInstanceOf(UnsupportedEncodingException.class).hasMessage(
-                "Unexpected end of string while decoding " + toDecode);
+        }).isInstanceOf(UnsupportedEncodingException.class).hasMessage("Unexpected end of string while decoding " + toDecode);
     }
 
     @Test
@@ -290,8 +278,7 @@ public class AlphabetConverterTest {
         assertThatThrownBy(() -> {
             final AlphabetConverter ac = createJavadocExample();
             ac.decode(toDecode);
-        }).isInstanceOf(UnsupportedEncodingException.class).hasMessage(
-                "Unexpected string without decoding (XX) in " + toDecode);
+        }).isInstanceOf(UnsupportedEncodingException.class).hasMessage("Unexpected string without decoding (XX) in " + toDecode);
     }
 
     /**
@@ -299,8 +286,7 @@ public class AlphabetConverterTest {
      */
     @Test
     public void unicodeTest() throws UnsupportedEncodingException {
-        final AlphabetConverter ac = AlphabetConverter.createConverter(UNICODE, LOWER_CASE_ENGLISH_CODEPOINTS,
-            DO_NOT_ENCODE_CODEPOINTS);
+        final AlphabetConverter ac = AlphabetConverter.createConverter(UNICODE, LOWER_CASE_ENGLISH_CODEPOINTS, DO_NOT_ENCODE_CODEPOINTS);
 
         assertThat(ac.getEncodedCharLength()).isEqualTo(2);
 
@@ -308,8 +294,7 @@ public class AlphabetConverterTest {
         final String encoded = ac.encode(original);
         final String decoded = ac.decode(encoded);
 
-        assertThat(decoded).as("Encoded '" + original + "' into '" + encoded + "', but decoded into '" + decoded + "'")
-            .isEqualTo(original);
+        assertThat(decoded).as("Encoded '" + original + "' into '" + encoded + "', but decoded into '" + decoded + "'").isEqualTo(original);
     }
 
 }
diff --git a/src/test/java/org/apache/commons/text/lookup/FileStringLookupTest.java b/src/test/java/org/apache/commons/text/lookup/FileStringLookupTest.java
index a6c83e79..7c3fc252 100644
--- a/src/test/java/org/apache/commons/text/lookup/FileStringLookupTest.java
+++ b/src/test/java/org/apache/commons/text/lookup/FileStringLookupTest.java
@@ -33,7 +33,8 @@ public class FileStringLookupTest {
 
     @Test
     public void testBadCharsetName() {
-        assertThrows(IllegalArgumentException.class, () -> FileStringLookup.INSTANCE.lookup("BAD_CHARSET_NAME:src/test/resources/org/apache/commons/text/document.properties"));
+        assertThrows(IllegalArgumentException.class,
+            () -> FileStringLookup.INSTANCE.lookup("BAD_CHARSET_NAME:src/test/resources/org/apache/commons/text/document.properties"));
     }
 
     @Test
@@ -55,8 +56,7 @@ public class FileStringLookupTest {
     public void testOne() throws Exception {
         final byte[] expectedBytes = Files.readAllBytes(Paths.get("src/test/resources/org/apache/commons/text/document.properties"));
         final String expectedString = new String(expectedBytes, StandardCharsets.UTF_8);
-        Assertions.assertEquals(expectedString,
-            FileStringLookup.INSTANCE.lookup("UTF-8:src/test/resources/org/apache/commons/text/document.properties"));
+        Assertions.assertEquals(expectedString, FileStringLookup.INSTANCE.lookup("UTF-8:src/test/resources/org/apache/commons/text/document.properties"));
     }
 
     @Test
diff --git a/src/test/java/org/apache/commons/text/similarity/IntersectionSimilarityTest.java b/src/test/java/org/apache/commons/text/similarity/IntersectionSimilarityTest.java
index cdb7c9b3..b5deda14 100644
--- a/src/test/java/org/apache/commons/text/similarity/IntersectionSimilarityTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/IntersectionSimilarityTest.java
@@ -39,8 +39,7 @@ public class IntersectionSimilarityTest {
     public void testIntersectionUsingSetCharacter() {
         // Compute using single characters.
         // This test uses a set and so should not allow duplicates.
-        final IntersectionSimilarity<Character> similarity =
-                new IntersectionSimilarity<>(IntersectionSimilarityTest::toCharacterSet);
+        final IntersectionSimilarity<Character> similarity = new IntersectionSimilarity<>(IntersectionSimilarityTest::toCharacterSet);
 
         // Expected:
         // size A or B = count of unique characters (exclude duplicates)
@@ -64,8 +63,7 @@ public class IntersectionSimilarityTest {
     public void testIntersectionUsingListCharacter() {
         // Compute using single characters.
         // This test uses a list and so duplicates should be matched.
-        final IntersectionSimilarity<Character> similarity =
-                new IntersectionSimilarity<>(IntersectionSimilarityTest::toCharacterList);
+        final IntersectionSimilarity<Character> similarity = new IntersectionSimilarity<>(IntersectionSimilarityTest::toCharacterList);
 
         // Expected:
         // size A or B = sequence length
@@ -90,8 +88,7 @@ public class IntersectionSimilarityTest {
         // Compute using pairs of characters (bigrams).
         // This can be done using a 32-bit int to store two 16-bit characters.
         // This test uses a set and so should not allow duplicates.
-        final IntersectionSimilarity<Integer> similarity =
-                new IntersectionSimilarity<>(IntersectionSimilarityTest::toBigramSet);
+        final IntersectionSimilarity<Integer> similarity = new IntersectionSimilarity<>(IntersectionSimilarityTest::toBigramSet);
 
         // Expected:
         // size A or B = count of unique bigrams (exclude duplicates)
@@ -116,8 +113,7 @@ public class IntersectionSimilarityTest {
         // Compute using pairs of characters (bigrams).
         // This can be done using a 32-bit int to store two 16-bit characters.
         // This test uses a list and so duplicates should be matched.
-        final IntersectionSimilarity<Integer> similarity =
-                new IntersectionSimilarity<>(IntersectionSimilarityTest::toBigramList);
+        final IntersectionSimilarity<Integer> similarity = new IntersectionSimilarity<>(IntersectionSimilarityTest::toBigramList);
 
         // Expected:
         // size A or B = sequence length - 1
@@ -146,8 +142,7 @@ public class IntersectionSimilarityTest {
         final String sequence2 = "aaaaaabbbfffff";
         converter.put(sequence1, toCharacterSet(sequence1));
         converter.put(sequence2, toCharacterList(sequence2));
-        final IntersectionSimilarity<Character> similarity =
-                new IntersectionSimilarity<>(converter::get);
+        final IntersectionSimilarity<Character> similarity = new IntersectionSimilarity<>(converter::get);
 
         // Expected:
         // size A = count of unique characters (exclude duplicates)
@@ -188,8 +183,8 @@ public class IntersectionSimilarityTest {
     }
 
     /**
-     * Convert the {@link CharSequence} to a {@link Set} of bigrams (pairs of characters).
-     * These are represented using 2 16-bit chars packed into a 32-bit int.
+     * Convert the {@link CharSequence} to a {@link Set} of bigrams (pairs of characters). These are represented using 2
+     * 16-bit chars packed into a 32-bit int.
      *
      * @param sequence the sequence
      * @return the set
@@ -209,8 +204,8 @@ public class IntersectionSimilarityTest {
     }
 
     /**
-     * Convert the {@link CharSequence} to a {@link List} of bigrams (pairs of characters).
-     * These are represented using 2 16-bit chars packed into a 32-bit int.
+     * Convert the {@link CharSequence} to a {@link List} of bigrams (pairs of characters). These are represented using 2
+     * 16-bit chars packed into a 32-bit int.
      *
      * @param sequence the sequence
      * @return the list
@@ -229,8 +224,8 @@ public class IntersectionSimilarityTest {
         return list;
     }
 
-    private static <T> void assertIntersection(final IntersectionSimilarity<T> similarity,
-            final CharSequence cs1, final CharSequence cs2, final int sizeA, final int sizeB, final int intersection) {
+    private static <T> void assertIntersection(final IntersectionSimilarity<T> similarity, final CharSequence cs1, final CharSequence cs2, final int sizeA,
+        final int sizeB, final int intersection) {
         final IntersectionResult result = similarity.apply(cs1, cs2);
         assertEquals(sizeA, result.getSizeA(), "Size A error");
         assertEquals(sizeB, result.getSizeB(), "Size B error");
@@ -317,16 +312,19 @@ public class IntersectionSimilarityTest {
 
     @Test
     public void testApplyNullNull() {
-        assertThatIllegalArgumentException().isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply(null, null));
+        assertThatIllegalArgumentException()
+            .isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply(null, null));
     }
 
     @Test
     public void testApplyStringNull() {
-        assertThatIllegalArgumentException().isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply("left", null));
+        assertThatIllegalArgumentException()
+            .isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply("left", null));
     }
 
     @Test
     public void testApplyNullString() {
-        assertThatIllegalArgumentException().isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply(null, "right"));
+        assertThatIllegalArgumentException()
+            .isThrownBy(() -> new IntersectionSimilarity<>(cs -> new HashSet<>(Collections.singletonList(cs))).apply(null, "right"));
     }
 }