public static String javaforLoop(String str) {
        StringBuilder result = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            result.append(c);
        }
        return result.toString();
    }
@Test
    public void whenUseJavaForLoop_thenIterate() {
        String input = "Hello, Baeldung!";
        String expectedOutput = "Hello, Baeldung!";
        String result = StringIterator.javaforLoop(input);
        assertEquals(expectedOutput, result);
    }