ObjectUtils { public static boolean equalsOneOf(Object value, Object... expected) { for (Object expectedValue : expected) { if (Objects.equals(value, expectedValue)) { return true; } } return false; } 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 equalsOneOf() { Assertions.assertTrue(ObjectUtils.equalsOneOf("value", OBJECT, "value", OBJECT)); Assertions.assertFalse(ObjectUtils.equalsOneOf("value", OBJECT, OBJECT, OBJECT)); }