You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static <T, Z> T getIfNotNull(final Z object, final Supplier objectValue) {
return object == null ? null : objectValue.get();
}
@test
public void test() {
final String id = null;
MatcherAssert.assertThat(ConditionalOperation.getIfNotNull(id, () -> id.toString()) == null, Is.is(true)); // working
MatcherAssert.assertThat(ConditionalOperation.getIfNotNull(id, id::toString) == null, Is.is(true));
// not working
}
The text was updated successfully, but these errors were encountered:
public static <T, Z> T getIfNotNull(final Z object, final Supplier objectValue) {
return object == null ? null : objectValue.get();
}
@test
public void test() {
final String id = null;
MatcherAssert.assertThat(ConditionalOperation.getIfNotNull(id, () -> id.toString()) == null, Is.is(true)); // working
MatcherAssert.assertThat(ConditionalOperation.getIfNotNull(id, id::toString) == null, Is.is(true));
// not working
}
The text was updated successfully, but these errors were encountered: