@Test public void matchesPrimitiveTypes() { assertMatches(any(boolean.class), true); assertMatches(any(byte.class), (byte)1); assertMatches(any(char.class), 'x'); assertMatches(any(double.class), 5.0); assertMatches(any(float.class), 5.0f); assertMatches(any(int.class), 2); assertMatches(any(long.class), 4L); assertMatches(any(short.class), (short)1); }
@SuppressWarnings("unchecked") public static <T> Matcher<T> any(Class<T> type) { return (Matcher<T>) new IsInstanceOf(type); }
IsInstanceOf extends DiagnosingMatcher<Object> { @SuppressWarnings("unchecked") public static <T> Matcher<T> any(Class<T> type) { return (Matcher<T>) new IsInstanceOf(type); } }
IsInstanceOf extends DiagnosingMatcher<Object> { @SuppressWarnings("unchecked") public static <T> Matcher<T> any(Class<T> type) { return (Matcher<T>) new IsInstanceOf(type); } IsInstanceOf(Class<?> expectedClass); }
IsInstanceOf extends DiagnosingMatcher<Object> { @SuppressWarnings("unchecked") public static <T> Matcher<T> any(Class<T> type) { return (Matcher<T>) new IsInstanceOf(type); } IsInstanceOf(Class<?> expectedClass); @Override void describeTo(Description description); @SuppressWarnings("unchecked") static Matcher<T> instanceOf(Class<?> type); @SuppressWarnings("unchecked") static Matcher<T> any(Class<T> type); }
IsInstanceOf extends DiagnosingMatcher<Object> { @SuppressWarnings("unchecked") public static <T> Matcher<T> any(Class<T> type) { return (Matcher<T>) new IsInstanceOf(type); } IsInstanceOf(Class<?> expectedClass); @Override void describeTo(Description description); @SuppressWarnings("unchecked") static Matcher<T> instanceOf(Class<?> type); @SuppressWarnings("unchecked") static Matcher<T> any(Class<T> type);  }