Strings { public static String repeat(char value, int n) { return new String(new char[n]).replace("\0", String.valueOf(value)); } private  Strings(); static String toCsv(List<String> src); static String join(List<String> src, String delimiter); static String capitaliseFirstLetter(String string); static String lowercaseFirstLetter(String string); static String zeros(int n); static String repeat(char value, int n); static boolean isEmpty(String s);  }
@Test public void testRepeat() { assertThat(Strings.repeat('0', 0), is("")); assertThat(Strings.repeat('1', 3), is("111")); }