ToIntNullableImpl implements NullableExpression<T, ToInt<T>>, ToIntNullable<T> { @Override public ToIntNullable<T> mapIfPresent(IntUnaryOperator mapper) { return t -> isNull.test(t) ? null : mapper.applyAsInt(original.applyAsInt(t)); } ToIntNullableImpl(ToInt<T> original, Predicate<T> isNull); @Override ToInt<T> inner(); @Override Predicate<T> isNullPredicate(); @Override Integer apply(T t); @Override int applyAsInt(T t); @Override ToInt<T> orThrow(); @Override ToInt<T> orElseGet(ToInt<T> getter); @Override ToInt<T> orElse(Integer value); @Override ToDoubleNullable<T> mapToDoubleIfPresent(IntToDoubleFunction mapper); @Override ToIntNullable<T> mapIfPresent(IntUnaryOperator mapper); @Override long hash(T object); @Override int compare(T first, T second); @Override boolean isNull(T object); @Override boolean isNotNull(T object); @Override boolean equals(Object o); @Override int hashCode();  }
@Test void mapIfPresent() { final ToIntNullable<String> toIntNullable = instance.mapIfPresent(i -> 0); assertNotNull(toIntNullable); assertEquals(0, toIntNullable.applyAsInt("1")); assertNull(toIntNullable.apply(null)); }