ObjectUtils { public static <T, C> boolean equals(T object, C value, Object to, Function<T, C> getter) { return equals(object, to, ((a, b) -> Objects.equals(value, getter.apply(b)))); } private  ObjectUtils(); static @Nullable T cast(Class<T> clazz, @Nullable Object object); @SuppressWarnings("unchecked") static @Nullable T cast(Object object); static boolean isNotNull(@Nullable Object object); static boolean areNull(Object... objects); static boolean equalsOneOf(Object value, Object... expected); static boolean equals(T object, C value, Object to, Function<T, C> getter); @SuppressWarnings("unchecked") static boolean equals(T object, Object to, BiPredicate<T, T> equals);  }
@Test void testEquals() { Assertions.assertFalse(ObjectUtils.equals(5, "value", (a, b) -> true)); Object aObject = new Object(); Assertions.assertTrue(ObjectUtils.equals(aObject, aObject.toString(), aObject, Object::toString)); }