IsBetweenUpperBoundInclusive extends TypeSafeMatcher<T> { public static <T extends Comparable<T>> Matcher<T> betweenUpperBoundInclusive(final T from, final T to) { return new IsBetweenUpperBoundInclusive(from, to); } IsBetweenUpperBoundInclusive(final T from, final T to); static Matcher<T> betweenUpperBoundInclusive(final T from, final T to); @Override void describeTo(final Description description);  }
@Test public void testGivenThatFromIsNullWhenCreateInstanceThenNullPointerExceptionIsThrown() { thrown.expect(NullPointerException.class); IsBetweenUpperBoundInclusive.betweenUpperBoundInclusive(null, ""); fail("NullPointerException expected but not thrown"); }
@Test public void testGivenThatToIsNullWhenCreateInstanceThenNullPointerExceptionIsThrown() { thrown.expect(NullPointerException.class); IsBetweenUpperBoundInclusive.betweenUpperBoundInclusive("", null); fail("NullPointerException expected but not thrown"); }
@Test public void testGivenThatFromNotBeforeToWhenCreateInstanceThenIllegalArgumentExceptionIsThrown() { thrown.expect(IllegalArgumentException.class); IsBetweenUpperBoundInclusive.betweenUpperBoundInclusive("Z", "A"); fail("IllegalArgumentException comparison but not thrown"); }