CharBuffer { boolean nextIsDigit() { return hasRemaining() && isDigit(next()); } private  CharBuffer(char[] cs); @Override String toString(); public char[] cs; public int position; }
@Test public void nextIsDigit() { CharBuffer buffer = CharBuffer.fromString("c1"); assertFalse(buffer.nextIsDigit()); assertThat(buffer.get(), is('c')); assertTrue(buffer.nextIsDigit()); assertThat(buffer.get(), is('1')); assertFalse(buffer.nextIsDigit()); }