class OptionalShouldContainInstanceOf extends BasicErrorMessageFactory {

  private OptionalShouldContainInstanceOf(String message) {
    super(message);
  }

  /**
   * Indicates that a value should be present in an empty {@link java.util.Optional}.
   *
   * @param value Optional to be checked.
   * @param clazz the class to check the optional value against
   * @return an error message factory.
   * @throws java.lang.NullPointerException if optional is null.
   */
  public static OptionalShouldContainInstanceOf shouldContainInstanceOf(Object value, Class<?> clazz) {<FILL_FUNCTION_BODY>}
}

    Optional<?> optional = (Optional<?>) value;
    if (optional.isPresent()) {
      return new OptionalShouldContainInstanceOf(format("%nExpecting actual:%n %s%nto contain a value that is an instance of:%n %s%nbut did contain an instance of:%n %s",
                                                        optional.getClass().getSimpleName(), clazz.getName(),
                                                        optional.get().getClass().getName()));
    }
    return new OptionalShouldContainInstanceOf(format("%nExpecting actual:%n %s%nto contain a value that is an instance of:%n %s%nbut was empty",
                                                      optional.getClass().getSimpleName(), clazz.getName()));
  
<methods>public transient void <init>(java.lang.String, java.lang.Object[]) ,public java.lang.String create(org.assertj.core.description.Description, org.assertj.core.presentation.Representation) ,public java.lang.String create(org.assertj.core.description.Description) ,public java.lang.String create() ,public boolean equals(java.lang.Object) ,public int hashCode() ,public java.lang.String toString() <variables>protected final non-sealed java.lang.Object[] arguments,protected final non-sealed java.lang.String format,org.assertj.core.error.MessageFormatter formatter