@Test public void emptyStringValuesShouldBeIgnoredByFindMinMaxLengthsInSymbols() { String[] symbols = new String[] { "aaa", "" }; int[] results = CharSequenceToRegexMapper.findMinMaxLengthsInSymbols(symbols); assertEquals(3, results[0]); assertEquals(3, results[1]); }
static int[] findMinMaxLengthsInSymbols(String[] symbols) { int min = Integer.MAX_VALUE; int max = 0; for (String symbol : symbols) { int len = symbol.length(); if (len == 0) continue; min = Math.min(min, len); max = Math.max(max, len); } return new int[] { min, max }; }
CharSequenceToRegexMapper { static int[] findMinMaxLengthsInSymbols(String[] symbols) { int min = Integer.MAX_VALUE; int max = 0; for (String symbol : symbols) { int len = symbol.length(); if (len == 0) continue; min = Math.min(min, len); max = Math.max(max, len); } return new int[] { min, max }; } }
CharSequenceToRegexMapper { static int[] findMinMaxLengthsInSymbols(String[] symbols) { int min = Integer.MAX_VALUE; int max = 0; for (String symbol : symbols) { int len = symbol.length(); if (len == 0) continue; min = Math.min(min, len); max = Math.max(max, len); } return new int[] { min, max }; }  }
CharSequenceToRegexMapper { static int[] findMinMaxLengthsInSymbols(String[] symbols) { int min = Integer.MAX_VALUE; int max = 0; for (String symbol : symbols) { int len = symbol.length(); if (len == 0) continue; min = Math.min(min, len); max = Math.max(max, len); } return new int[] { min, max }; }   }
CharSequenceToRegexMapper { static int[] findMinMaxLengthsInSymbols(String[] symbols) { int min = Integer.MAX_VALUE; int max = 0; for (String symbol : symbols) { int len = symbol.length(); if (len == 0) continue; min = Math.min(min, len); max = Math.max(max, len); } return new int[] { min, max }; }    }