private static @Nullable <T, R> R apply(@NotNull Function<? super T, ? extends R> function, @Nullable T value) {
    return value == null ? null : function.apply(value);
  }
private static @Nullable <T, R> R apply(@NotNull Function<? super T, ? extends R> function, @Nullable T value)