@Test public void alternativeFactoryMethodAlsoMatchesOnlyIfArgumentIsReferenceToASpecifiedObject() { Object o1 = new Object(); Matcher<Object> matcher = theInstance(o1); assertMatches(matcher, o1); assertDoesNotMatch(matcher, new Object()); }
public static <T> Matcher<T> theInstance(T target) { return new IsSame<T>(target); }
IsSame extends BaseMatcher<T> { public static <T> Matcher<T> theInstance(T target) { return new IsSame<T>(target); } }
IsSame extends BaseMatcher<T> { public static <T> Matcher<T> theInstance(T target) { return new IsSame<T>(target); } IsSame(T object); }
IsSame extends BaseMatcher<T> { public static <T> Matcher<T> theInstance(T target) { return new IsSame<T>(target); } IsSame(T object); @Override boolean matches(Object arg); @Override void describeTo(Description description); static Matcher<T> sameInstance(T target); static Matcher<T> theInstance(T target); }
IsSame extends BaseMatcher<T> { public static <T> Matcher<T> theInstance(T target) { return new IsSame<T>(target); } IsSame(T object); @Override boolean matches(Object arg); @Override void describeTo(Description description); static Matcher<T> sameInstance(T target); static Matcher<T> theInstance(T target);  }