ToByteNullableImpl implements NullableExpression<T, ToByte<T>>, ToByteNullable<T> { @Override public ToDoubleNullable<T> mapToDoubleIfPresent(ByteToDoubleFunction mapper) { return t -> isNull.test(t) ? null : mapper.applyAsDouble(original.applyAsByte(t)); } ToByteNullableImpl(ToByte<T> original, Predicate<T> isNull); @Override ToByte<T> inner(); @Override Predicate<T> isNullPredicate(); @Override Byte apply(T t); @Override byte applyAsByte(T t); @Override ToByte<T> orThrow(); @Override ToByte<T> orElseGet(ToByte<T> getter); @Override ToByte<T> orElse(Byte value); @Override ToDoubleNullable<T> mapToDoubleIfPresent(ByteToDoubleFunction mapper); @Override ToByteNullable<T> mapIfPresent(ByteUnaryOperator 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() { ToDoubleNullable<String> toDoubleNullable = instance .mapToDoubleIfPresent(b -> 1); assertNotNull(toDoubleNullable); assertEquals(1, toDoubleNullable.applyAsDouble("three")); assertNull(toDoubleNullable.apply(null)); }