code: public static boolean isInstance(final @NonNull Optional<?> optional, final @NonNull Class<?> type) {
      return optional.isPresent() && type.isInstance(optional.get());
    }
docs: Tests if the value held by {@code optional} is an instance of {@code type}.
  
  @param optional the optional
  @param type the type
  @return {@code true} if the value held by {@code optional} is an instance of {@code type}, {@code false} otherwise