@Test
void enumOrElseThrow() {

    final ToEnumOrThrow<String, TestEnum> toEnumOrThrow = OrElseThrowUtil.enumOrElseThrow(
            ToEnumNullable.of(TestEnum.class, string -> string == null ?
                    null : TestEnum.valueOf(string)));
    assertEquals(TestEnum.A, toEnumOrThrow.apply("A"));
    assertThrows(NullPointerException.class, () -> toEnumOrThrow.apply(null));
}