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