ToLongNullableImpl implements NullableExpression<T, ToLong<T>>, ToLongNullable<T> { @Override public ToDoubleNullable<T> mapToDoubleIfPresent(LongToDoubleFunction mapper) { return t -> isNull.test(t) ? null : mapper.applyAsDouble(original.applyAsLong(t)); } ToLongNullableImpl(ToLong<T> original, Predicate<T> isNull); @Override ToLong<T> inner(); @Override Predicate<T> isNullPredicate(); @Override Long apply(T t); @Override long applyAsLong(T t); @Override ToLong<T> orThrow(); @Override ToLong<T> orElseGet(ToLong<T> getter); @Override ToLong<T> orElse(Long value); @Override ToDoubleNullable<T> mapToDoubleIfPresent(LongToDoubleFunction mapper); @Override ToLongNullable<T> mapIfPresent(LongUnaryOperator 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 mapToDoubleIfPresent() { final ToDoubleNullable<String> toDoubleNullable = instance .mapToDoubleIfPresent(i -> 1); assertNotNull(toDoubleNullable); assertEquals(1, toDoubleNullable.applyAsDouble("three")); assertNull(toDoubleNullable.apply(null)); }