@Test public void getAsDigit() {

    CharBuffer buffer = CharBuffer.fromString("c1");
    assertFalse(buffer.nextIsDigit());
    assertThat(buffer.get(), is('c'));
    assertTrue(buffer.nextIsDigit());
    assertThat(buffer.getAsDigit(), is(1));
    assertFalse(buffer.nextIsDigit());
}