ToShortNullableImpl implements NullableExpression<T, ToShort<T>>, ToShortNullable<T> { @Override public ToShort<T> orElse(Short value) { return t -> isNull.test(t) ? value : original.applyAsShort(t); } ToShortNullableImpl(ToShort<T> original, Predicate<T> isNull); @Override ToShort<T> inner(); @Override Predicate<T> isNullPredicate(); @Override Short apply(T t); @Override short applyAsShort(T t); @Override ToShort<T> orThrow(); @Override ToShort<T> orElseGet(ToShort<T> getter); @Override ToShort<T> orElse(Short value); @Override ToDoubleNullable<T> mapToDoubleIfPresent(ShortToDoubleFunction mapper); @Override ToShortNullable<T> mapIfPresent(ShortUnaryOperator 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 ToShort<String> toShort = instance.orElse((short) 0); assertNotNull(toShort); assertEquals("three".length(), toShort.applyAsShort("three")); assertEquals(0, toShort.applyAsShort(null)); }