public static String javaCharacterIterator(String str){
        StringBuilder result = new StringBuilder();
        CharacterIterator it = new StringCharacterIterator(str);  
        while (it.current() != CharacterIterator.DONE) { 
            result.append(it.current()); 
            it.next(); 
        }
        return result.toString();
    }
@Test
    public void whenUseCharacterIterator_thenIterate() {
        String input = "Hello, Baeldung!";
        String expectedOutput = "Hello, Baeldung!";
        String result = StringIterator.javaCharacterIterator(input);
        assertEquals(expectedOutput, result);
    }