@Test
void cast() {

    assertThrows(NullPointerException.class, () -> Cast.cast("value", null));
    final Optional<String> nullOptional = Cast.cast(null, String.class);
    assertFalse(nullOptional.isPresent());
    final Optional<String> illegalCastOptional = Cast.cast(1, String.class);
    assertFalse(illegalCastOptional.isPresent());
    final Optional<Number> successfulOptional = Cast.cast(1L, Number.class);
    assertTrue(successfulOptional.isPresent());
    assertEquals(1, successfulOptional.get().intValue());
}