CharBuffer { static int toDigit(char c) { return c - '0'; } private  CharBuffer(char[] cs); @Override String toString(); public char[] cs; public int position; }
@Test public void toDigit() { assertThat(CharBuffer.toDigit('0'), is(0)); assertThat(CharBuffer.toDigit('1'), is(1)); assertThat(CharBuffer.toDigit('2'), is(2)); assertThat(CharBuffer.toDigit('3'), is(3)); assertThat(CharBuffer.toDigit('4'), is(4)); assertThat(CharBuffer.toDigit('5'), is(5)); assertThat(CharBuffer.toDigit('6'), is(6)); assertThat(CharBuffer.toDigit('7'), is(7)); assertThat(CharBuffer.toDigit('8'), is(8)); assertThat(CharBuffer.toDigit('9'), is(9)); }