class ShouldContainCharSequenceOnlyOnce extends BasicErrorMessageFactory {

  /**
   * Creates a new <code>{@link ShouldContainCharSequenceOnlyOnce}</code>.
   * 
   * @param actual the actual value in the failed assertion.
   * @param sequence the String expected to be in {@code actual} only once.
   * @param occurrences the number of occurrences of sequence in actual.
   * @param comparisonStrategy the {@link ComparisonStrategy} used to evaluate assertion.
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldContainOnlyOnce(CharSequence actual, CharSequence sequence, int occurrences,
                                                          ComparisonStrategy comparisonStrategy) {<FILL_FUNCTION_BODY>}

  /**
   * Creates a new <code>{@link ShouldContainCharSequenceOnlyOnce}</code>.
   * 
   * @param actual the actual value in the failed assertion.
   * @param sequence the String expected to be in {@code actual} only once.
   * @param occurrences the number of occurrences of sequence in actual.
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldContainOnlyOnce(CharSequence actual, CharSequence sequence, int occurrences) {
    return shouldContainOnlyOnce(actual, sequence, occurrences, StandardComparisonStrategy.instance());
  }

  private ShouldContainCharSequenceOnlyOnce(CharSequence actual, CharSequence expected, int occurrences,
                                            ComparisonStrategy comparisonStrategy) {
    super("%nExpecting actual:%n  %s%nto appear only once in:%n  %s%nbut it appeared %s times %s", expected, actual,
          occurrences,
          comparisonStrategy);
  }

  private ShouldContainCharSequenceOnlyOnce(CharSequence actual, CharSequence expected, ComparisonStrategy comparisonStrategy) {
    super("%nExpecting actual:%n  %s%nto appear only once in:%n  %s%nbut it did not appear %s", expected, actual,
          comparisonStrategy);
  }
}

    if (occurrences == 0) return new ShouldContainCharSequenceOnlyOnce(actual, sequence, comparisonStrategy);
    return new ShouldContainCharSequenceOnlyOnce(actual, sequence, occurrences, comparisonStrategy);
  
<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