### Question:
PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private  PageRange(int lowerBound, int upperBound); int getLowerBound(); int getUpperBound(); boolean isRange(); @NotNull static PageRange parse(@NotNull String pages); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void throwsNumberFormatExceptionIfLowerBoundNotANumber() { mExpectedException.expect(NumberFormatException.class); PageRange.parse("q"); }
@Test public void throwsNumberFormatExceptionIfUpperBoundNotANumber() { mExpectedException.expect(NumberFormatException.class); PageRange.parse("1-q"); }
@Test public void should_not_allow_null() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Pages should not be null"); PageRange.parse(null); }