public static String repeat(char value, int n) {
        return new String(new char[n]).replace("\0", String.valueOf(value));
    }
@Test
    public void testRepeat() {
        assertEquals(repeat('0', 0), (""));
        assertEquals(repeat('1', 3), ("111"));
    }