### Question:
XSDPrimitiveTypeParser { public static int parseInt(final Reader reader) throws IOException { boolean isNegative = false; int result = 0; int c = reader.read(); if (isSign(c)) { isNegative = (c == '-') ? true : false; c = reader.read(); } while (c != -1) { result = accumulateIntegerDecimal(c, result); c = reader.read(); } if ((result == Integer.MIN_VALUE) && !isNegative) { throw new NumberFormatException("Integer overflow"); } return isNegative ? result : -result; }  static short parseShort(final Reader reader); static int parseInt(final Reader reader); static long parseLong(final Reader reader); static float parseFloat(final Reader reader); static double parseDouble(final Reader reader);  }### Answer:
@Test public void testGoodInt() throws IOException { for (final String s : goodIntStrings) { try { checkInt(s, XSDPrimitiveTypeParser.parseInt(new StringReader(s))); } catch (final NumberFormatException e) { throw new RuntimeException("parseLong failed. " + "String:" + s + ". " + e.getMessage()); } } }
@Test(expected=NumberFormatException.class) public void testOverflowMaxInt() throws IOException { XSDPrimitiveTypeParser.parseInt(new StringReader("2147483648")); }
@Test(expected=NumberFormatException.class) public void testOverflowMinInt() throws IOException { XSDPrimitiveTypeParser.parseInt(new StringReader("-2147483649")); }
@Test(expected=NumberFormatException.class) public void testInvalidInt() throws IOException { XSDPrimitiveTypeParser.parseInt(new StringReader("fdaslk")); }