private int[] findWordIndexes(final Collection<? extends CharSequence> split) throws UnexpectedWhiteSpaceException, WordNotFoundException { final int ms = split.size(); final int[] result = new int[ms]; int i = 0; for (final CharSequence buffer : split) { if (buffer.length() == 0) { throw new UnexpectedWhiteSpaceException(); } result[i++] = findWordIndex(buffer); } return result; }
private int[] findWordIndexes(final Collection<? extends CharSequence> split) throws UnexpectedWhiteSpaceException, WordNotFoundException { final int ms = split.size(); final int[] result = new int[ms]; int i = 0; for (final CharSequence buffer : split) { if (buffer.length() == 0) { throw new UnexpectedWhiteSpaceException(); } result[i++] = findWordIndex(buffer); } return result; }
@Test public void UnexpectedWhiteSpaceException_message() throws Exception { assertEquals("Unexpected whitespace", new UnexpectedWhiteSpaceException().getMessage()); }