class OptionalAssert<T> extends AbstractAssert<OptionalAssert<T>, Optional<T>> {

  protected OptionalAssert(final Optional<T> actual) {
    super(actual, OptionalAssert.class);
  }

  // visible for test
  protected Optional<T> getActual() {
    return actual;
  }

  /**
   * Verifies that the actual {@link Optional} contains the given value.<br>
   * <p>
   * Example :
   *
   * <pre><code class='java'> Optional&lt;String&gt; optional = Optional.of(&quot;Test&quot;);
   *
   * assertThat(optional).contains(&quot;Test&quot;);</code></pre>
   *
   * @param value the value to look for in actual {@link Optional}.
   * @return this {@link OptionalAssert} for assertions chaining.
   *
   * @throws AssertionError if the actual {@link Optional} is {@code null}.
   * @throws AssertionError if the actual {@link Optional} contains nothing or does not have the given value.
   */
  @SuppressWarnings("deprecation")
  public OptionalAssert<T> contains(final Object value) {
    isNotNull();
    if (!actual.isPresent()) {
      throw assertionError(shouldBePresentWithValue(value));
    }
    if (!areEqual(actual.get(), value)) {
      throw assertionError(shouldBePresentWithValue(actual, value));
    }
    return this;
  }

  /**
   * Verifies that the actual {@link Optional} contained instance is absent/null (ie. not {@link Optional#isPresent()}).<br>
   * <p>
   * Example :
   *
   * <pre><code class='java'> Optional&lt;String&gt; optional = Optional.absent();
   *
   * assertThat(optional).isAbsent();</code></pre>
   *
   * @return this {@link OptionalAssert} for assertions chaining.
   *
   * @throws AssertionError if the actual {@link Optional} is {@code null}.
   * @throws AssertionError if the actual {@link Optional} contains a (non-null) instance.
   */
  public OptionalAssert<T> isAbsent() {
    isNotNull();
    if (actual.isPresent()) {
      throw assertionError(shouldBeAbsent(actual));
    }
    return this;
  }

  /**
   * Verifies that the actual {@link Optional} contains a (non-null) instance.<br>
   * <p>
   * Example :
   *
   * <pre><code class='java'> Optional&lt;String&gt; optional = Optional.of(&quot;value&quot;);
   *
   * assertThat(optional).isPresent();</code></pre>
   *
   * @return this {@link OptionalAssert} for assertions chaining.
   *
   * @throws AssertionError if the actual {@link Optional} is {@code null}.
   * @throws AssertionError if the actual {@link Optional} contains a null instance.
   */
  public OptionalAssert<T> isPresent() {<FILL_FUNCTION_BODY>}

  /**
   * Chain assertion on the content of the {@link Optional}.
   * <p>
   * Example :
   *
   * <pre><code class='java'> Optional&lt;Number&gt; optional = Optional.of(12L);
   *
   * assertThat(optional).extractingValue().isInstanceOf(Long.class);</code></pre>
   *
   * @return a new {@link AbstractObjectAssert} for assertions chaining on the content of the Optional.
   * @throws AssertionError if the actual {@link Optional} is {@code null}.
   * @throws AssertionError if the actual {@link Optional} contains a null instance.
   */
  public AbstractObjectAssert<?, T> extractingValue() {
    isPresent();
    T assertion = actual.get();
    return assertThat(assertion);
  }

  /**
   * Chain assertion on the content of the {@link Optional}.
   * <p>
   * Example :
   *
   * <pre><code class='java'> Optional&lt;String&gt; optional = Optional.of("Bill");
   *
   * assertThat(optional).extractingCharSequence().startsWith("Bi");</code></pre>
   *
   * @return a new {@link AbstractCharSequenceAssert} for assertions chaining on the content of the Optional.
   * @throws AssertionError if the actual {@link Optional} is {@code null}.
   * @throws AssertionError if the actual {@link Optional} contains a null instance.
   */
  public AbstractCharSequenceAssert<?, ? extends CharSequence> extractingCharSequence() {
    isPresent();
    assertThat(actual.get()).isInstanceOf(CharSequence.class);
    return assertThat((CharSequence) actual.get());
  }

}

    isNotNull();
    if (!actual.isPresent()) {
      throw assertionError(shouldBePresent(actual));
    }
    return this;
  
<methods>public ASSERT asInstanceOf(InstanceOfAssertFactory<?,ASSERT>) ,public AbstractListAssert<?,List<?>,java.lang.Object,ObjectAssert<java.lang.Object>> asList() ,public AbstractStringAssert<?> asString() ,public OptionalAssert<T> describedAs(org.assertj.core.description.Description) ,public java.lang.String descriptionText() ,public OptionalAssert<T> doesNotHave(Condition<? super Optional<T>>) ,public OptionalAssert<T> doesNotHaveSameClassAs(java.lang.Object) ,public OptionalAssert<T> doesNotHaveSameHashCodeAs(java.lang.Object) ,public OptionalAssert<T> doesNotHaveToString(java.lang.String) ,public transient OptionalAssert<T> doesNotHaveToString(java.lang.String, java.lang.Object[]) ,public boolean equals(java.lang.Object) ,public org.assertj.core.api.WritableAssertionInfo getWritableAssertionInfo() ,public OptionalAssert<T> has(Condition<? super Optional<T>>) ,public OptionalAssert<T> hasSameClassAs(java.lang.Object) ,public OptionalAssert<T> hasSameHashCodeAs(java.lang.Object) ,public OptionalAssert<T> hasToString(java.lang.String) ,public transient OptionalAssert<T> hasToString(java.lang.String, java.lang.Object[]) ,public int hashCode() ,public OptionalAssert<T> is(Condition<? super Optional<T>>) ,public OptionalAssert<T> isEqualTo(java.lang.Object) ,public OptionalAssert<T> isExactlyInstanceOf(Class<?>) ,public transient OptionalAssert<T> isIn(java.lang.Object[]) ,public OptionalAssert<T> isIn(Iterable<?>) ,public OptionalAssert<T> isInstanceOf(Class<?>) ,public transient OptionalAssert<T> isInstanceOfAny(Class<?>[]) ,public OptionalAssert<T> isInstanceOfSatisfying(Class<T>, Consumer<T>) ,public OptionalAssert<T> isNot(Condition<? super Optional<T>>) ,public OptionalAssert<T> isNotEqualTo(java.lang.Object) ,public OptionalAssert<T> isNotExactlyInstanceOf(Class<?>) ,public transient OptionalAssert<T> isNotIn(java.lang.Object[]) ,public OptionalAssert<T> isNotIn(Iterable<?>) ,public OptionalAssert<T> isNotInstanceOf(Class<?>) ,public transient OptionalAssert<T> isNotInstanceOfAny(Class<?>[]) ,public OptionalAssert<T> isNotNull() ,public transient OptionalAssert<T> isNotOfAnyClassIn(Class<?>[]) ,public OptionalAssert<T> isNotSameAs(java.lang.Object) ,public void isNull() ,public transient OptionalAssert<T> isOfAnyClassIn(Class<?>[]) ,public OptionalAssert<T> isSameAs(java.lang.Object) ,public OptionalAssert<T> matches(Predicate<? super Optional<T>>) ,public OptionalAssert<T> matches(Predicate<? super Optional<T>>, java.lang.String) ,public transient OptionalAssert<T> overridingErrorMessage(java.lang.String, java.lang.Object[]) ,public OptionalAssert<T> overridingErrorMessage(Supplier<java.lang.String>) ,public OptionalAssert<T> satisfies(Condition<? super Optional<T>>) ,public final transient OptionalAssert<T> satisfies(Consumer<? super Optional<T>>[]) ,public final transient OptionalAssert<T> satisfies(ThrowingConsumer<? super Optional<T>>[]) ,public final transient OptionalAssert<T> satisfiesAnyOf(Consumer<? super Optional<T>>[]) ,public final transient OptionalAssert<T> satisfiesAnyOf(ThrowingConsumer<? super Optional<T>>[]) ,public static void setCustomRepresentation(org.assertj.core.presentation.Representation) ,public static void setDescriptionConsumer(Consumer<org.assertj.core.description.Description>) ,public static void setPrintAssertionsDescription(boolean) ,public OptionalAssert<T> usingComparator(Comparator<? super Optional<T>>) ,public OptionalAssert<T> usingComparator(Comparator<? super Optional<T>>, java.lang.String) ,public OptionalAssert<T> usingDefaultComparator() ,public transient OptionalAssert<T> withFailMessage(java.lang.String, java.lang.Object[]) ,public OptionalAssert<T> withFailMessage(Supplier<java.lang.String>) ,public OptionalAssert<T> withRepresentation(org.assertj.core.presentation.Representation) ,public OptionalAssert<T> withThreadDumpOnError() <variables>private static final java.lang.String ORG_ASSERTJ,protected final non-sealed Optional<T> actual,org.assertj.core.error.AssertionErrorCreator assertionErrorCreator,org.assertj.core.internal.Conditions conditions,static org.assertj.core.presentation.Representation customRepresentation,private static Consumer<org.assertj.core.description.Description> descriptionConsumer,public org.assertj.core.api.WritableAssertionInfo info,protected final non-sealed OptionalAssert<T> myself,protected org.assertj.core.internal.Objects objects,static boolean printAssertionsDescription,public static boolean throwUnsupportedExceptionOnEquals