public static String javaCharArray(String str){
        StringBuilder result = new StringBuilder();
        for (char c : str.toCharArray()) { 
            result.append(c);
        }
        return result.toString();
    }
@Test
    public void whenUseCharArrayMethod_thenIterate() {
        String input = "Hello, Baeldung!";
        String expectedOutput = "Hello, Baeldung!";
        String result = StringIterator.javaCharArray(input);
        assertEquals(expectedOutput, result);
    }