Formatting { public static String alignTabs(String rows) { final List<String> list = Stream.of(rows.split(nl())).collect(toList()); alignTabs(list); return list.stream().collect(joining(nl())); } private  Formatting(); static String separate(String separator, String... blocks); static String lcfirst(String input); static String ucfirst(String input); static String withFirst(String input, Function<Character, String> callback); static String repeat(String str, int count); static String block(String text); static String block(String row, String... rows); static String block(Stream<String> rows); static String indent(String text); static String indent(String... text); static String indent(Stream<String> text); static String indent(String text, int steps); static R ifelse(Optional<E> condition, Function<E, R> trueMap, R falseValue); static String nl(); static void nl(String nl); static String dnl(); static String tab(); static void tab(String tab); static String shortName(String longName); static Optional<String> packageName(String longName); static Optional<String> fileToClassName(String fileName); static String classToJavaFileName(String longName); static String stripGenerics(String className); static String alignTabs(String rows); static void alignTabs(List<String> rows); static String unQuote(final String s); static String staticField(final String externalName); static String toUnderscoreSeparated(final String javaName); static String javaNameFromExternal(final String externalName); static String nameFromExternal(final String externalName); static String replaceIfJavaUsedWord(final String word); static String replaceIfIllegalJavaIdentifierCharacter(final String word);  }
@Test void alignTabs() { final String result = Formatting.alignTabs("a\t=1;" + Formatting.nl() + "veryLongName\t=2;"); final String[] rows = result.split(Formatting.nl()); assertEquals(rows[0].length(), rows[1].length()); }
@Test void testAlignTabs() { final List<String> rows = new ArrayList<>(Arrays.asList("a\t=1;", "veryLongName\t=2;")); Formatting.alignTabs(rows); assertEquals(rows.get(0).length(), rows.get(1).length()); }