ToLongNullableImpl implements NullableExpression<T, ToLong<T>>, ToLongNullable<T> { @Override public ToLong<T> orElse(Long value) { return t -> isNull.test(t) ? value : 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 orElse() { final ToLong<String> toLong = instance.orElse((long) 0); assertNotNull(toLong); assertEquals("three".length(), toLong.applyAsLong("three")); assertEquals(0, toLong.applyAsLong(null)); }