@Test public void findMinMaxLengthsInSymbolsWithTrivialInputs() { String[] symbols = new String[]{"a", "bb"}; int[] results = CharSequenceToRegexMapper.findMinMaxLengthsInSymbols(symbols); assertEquals(1, results[0]); assertEquals(2, 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}; }    }