class Strings {

    public static String repeat(char c, int count) {
        if (count < 1) return EMPTY_STRING;
        char[] chars = new char[count];
        Arrays.fill(chars, c);
        return new String(chars);
    }

}

class StringsTest {

    @Test
    public void repeatTest() {

        assertEquals(repeat('c', -1), "");
        assertEquals(repeat('c', 3), "ccc");
        assertEquals(repeat('c', 1), "c");
        assertEquals(repeat('c', 0), "");

        assertNull(repeat(null, 1));
        assertEquals(repeat("ab", -1), "");
        assertEquals(repeat("ab", 3), "ababab");
        assertEquals(repeat("ab", 1), "ab");
        assertEquals(repeat("ab", 0), "");
    }

}