@Test
public void index() {

    String letters = "abcd";
    assertEquals(
            'a',
            idx( letters, 0 )
    );
    assertEquals(
            'd',
            idx( letters, -1 )
    );
    assertEquals(
            'd',
            idx( letters, letters.length() - 1 )
    );
    letters = idx( letters, 1, 'z' );
    assertEquals(
            'z',
            idx( letters, 1 )
    );
}