OrElseThrowUtil { public static <T> ToByteOrThrow<T> byteOrElseThrow(ToByteNullable<T> expression) { return new ToByteOrElseThrowImpl<>(expression); } private  OrElseThrowUtil(); static ToDoubleOrThrow<T> doubleOrElseThrow(ToDoubleNullable<T> expression); static ToFloatOrThrow<T> floatOrElseThrow(ToFloatNullable<T> expression); static ToLongOrThrow<T> longOrElseThrow(ToLongNullable<T> expression); static ToIntOrThrow<T> intOrElseThrow(ToIntNullable<T> expression); static ToShortOrThrow<T> shortOrElseThrow(ToShortNullable<T> expression); static ToByteOrThrow<T> byteOrElseThrow(ToByteNullable<T> expression); static ToCharOrThrow<T> charOrElseThrow(ToCharNullable<T> expression); static ToBooleanOrThrow<T> booleanOrElseThrow(ToBooleanNullable<T> expression); static ToStringOrThrow<T> stringOrElseThrow(ToStringNullable<T> expression); static ToBigDecimalOrThrow<T> bigDecimalOrElseThrow(ToBigDecimalNullable<T> expression); static ToEnumOrThrow<T, E> enumOrElseThrow(ToEnumNullable<T, E> expression);  }
@Test void byteOrElseThrow() { final ToByteOrThrow<Byte> toByteOrThrow = OrElseThrowUtil.byteOrElseThrow(d -> d); assertEquals(1, toByteOrThrow.applyAsByte((byte) 1)); assertThrows(NullPointerException.class, () -> toByteOrThrow.applyAsByte(null)); }