ObjectTypeValidator implements BiPredicate<Object, Object> { @Override public boolean test(@NonNull Object objectOne, @NonNull Object objectTwo) { ObjectTypeRetriever retriever = new ObjectTypeRetriever(); return retriever.apply(objectOne).equals(retriever.apply(objectTwo)); }  @Override boolean test(@NonNull Object objectOne, @NonNull Object objectTwo);  }
@Test public void compareValidClassAndClassThenReturnTrue() { boolean result = new ObjectTypeValidator().test(A.class, A.class); assertTrue(result); }
@Test public void compareValidObjectAndClassThenReturnTrue() { boolean result = new ObjectTypeValidator().test(new A(), A.class); assertTrue(result); }
@Test public void compareValidObjectAndObjectThenReturnTrue() { boolean result = new ObjectTypeValidator().test(new A(), new A()); assertTrue(result); }
@Test public void compareInvalidClassAndClassThenReturnFalse() { boolean result = new ObjectTypeValidator().test(A.class, B.class); assertFalse(result); }
@Test public void compareInvalidObjectAndClassThenReturnFalse() { boolean result = new ObjectTypeValidator().test(new A(), B.class); assertFalse(result); }
@Test public void compareInvalidObjectAndObjectThenReturnTrue() { boolean result = new ObjectTypeValidator().test(new A(), new B()); assertFalse(result); }
@Test public void compareNullAndClassThenReturnFalse() { boolean result = new ObjectTypeValidator().test(null, A.class); assertFalse(result); }
@Test public void compareNullAndObjectThenReturnFalse() { boolean result = new ObjectTypeValidator().test(null, new A()); assertFalse(result); }
@Test public void compareNullAndNullThenReturnTrue() { boolean result = new ObjectTypeValidator().test(null, null); assertTrue(result); }