### Question:
B2JsonReader { public String readNumberAsString() throws IOException, B2JsonException { skipWhitespace(); builder.setLength(0); if (currentChar == '-') { appendAndNext(); } if (!isDigit(currentChar)) { throw new B2JsonException("Bad number"); } if (currentChar == '0') { appendAndNext(); if (isDigit(currentChar)) { throw new B2JsonException("Number cannot start with 0 and then have another digit"); } } else { while (isDigit(currentChar)) { appendAndNext(); } } if (currentChar == '.') { appendAndNext(); while (isDigit(currentChar)) { appendAndNext(); } } if (currentChar == 'e' || currentChar == 'E') { appendAndNext(); if (currentChar == '+' || currentChar == '-') { appendAndNext(); } if (!isDigit(currentChar)) { throw new B2JsonException("Bad number"); } while (isDigit(currentChar)) { appendAndNext(); } } return builder.toString(); } B2JsonReader(Reader in); char peekNextNotWhitespaceChar(); void skipValue(); String readNumberAsString(); String readString(); boolean startObjectAndCheckForContents(); boolean objectHasMoreFields(); boolean nextNonWhitespaceIsEof(); String readObjectFieldNameAndColon(); void skipObjectColon(); void finishObject(); boolean startArrayAndCheckForContents(); boolean arrayHasMoreValues(); void finishArray(); void readNull(); void readFalse(); void readTrue();  }### Answer:
@Test public void testReadNumberAsString() throws IOException, B2JsonException { checkNumber("xxx", null); checkNumber("5 a", "5"); checkNumber("999 5", "999"); checkNumber("-0 5", "-0"); checkNumber("05", null); checkNumber(".45", null); checkNumber("0.45", "0.45"); checkNumber("123.", "123."); checkNumber("3.14", "3.14"); checkNumber("5e10", "5e10"); checkNumber("5e+10", "5e+10"); checkNumber("5e-10", "5e-10"); checkNumber("5ex10", null); checkNumber(" }