class ShouldHaveCauseInstance extends BasicErrorMessageFactory {

  /**
   * Creates a new <code>{@link org.assertj.core.error.BasicErrorMessageFactory}</code>.
   * 
   * @param actual the actual value in the failed assertion.
   * @param expectedCauseType the expected cause type.
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldHaveCauseInstance(Throwable actual,
                                                            Class<? extends Throwable> expectedCauseType) {<FILL_FUNCTION_BODY>}

  private ShouldHaveCauseInstance(Throwable actual, Class<? extends Throwable> expectedCauseType) {
    super("%nExpecting a throwable with cause being an instance of:%n" +
          "  %s%n" +
          "but was an instance of:%n" +
          "  %s%n" +
          "Throwable that failed the check:%n" +
          "%n" + escapePercent(getStackTrace(actual)),
          expectedCauseType, actual.getCause().getClass());
  }

  private ShouldHaveCauseInstance(Class<? extends Throwable> expectedCauseType) {
    super("%nExpecting a throwable with cause being an instance of:%n" +
          "  %s%n" +
          "but current throwable has no cause.",
          expectedCauseType);
  }
}

    return actual.getCause() == null
        ? new ShouldHaveCauseInstance(expectedCauseType)
        : new ShouldHaveCauseInstance(actual, expectedCauseType);
  
<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