class ShouldContainsOnlyOnce extends BasicErrorMessageFactory {

  /**
   * Creates a new <code>{@link ShouldContainsOnlyOnce}</code>.
   * 
   * @param actual the actual value in the failed assertion.
   * @param expected values expected to be contained in {@code actual}.
   * @param notFound values in {@code expected} not found in {@code actual}.
   * @param notOnlyOnce values in {@code actual} that were not only once in {@code expected}.
   * @param comparisonStrategy the {@link ComparisonStrategy} used to evaluate assertion.
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldContainsOnlyOnce(Object actual, Object expected, Set<?> notFound,
                                                           Set<?> notOnlyOnce, ComparisonStrategy comparisonStrategy) {<FILL_FUNCTION_BODY>}

  /**
   * Creates a new <code>{@link ShouldContainsOnlyOnce}</code>.
   * 
   * @param actual the actual value in the failed assertion.
   * @param expected values expected to be contained in {@code actual}.
   * @param notFound values in {@code expected} not found in {@code actual}.
   * @param notOnlyOnce values in {@code actual} that were found not only once in {@code expected}.
   * @return the created {@code ErrorMessageFactory}.
   */
  public static ErrorMessageFactory shouldContainsOnlyOnce(Object actual, Object expected, Set<?> notFound,
                                                           Set<?> notOnlyOnce) {
    return shouldContainsOnlyOnce(actual, expected, notFound, notOnlyOnce, StandardComparisonStrategy.instance());
  }

  private ShouldContainsOnlyOnce(Object actual, Object expected, Set<?> notFound, Set<?> notOnlyOnce,
                                 ComparisonStrategy comparisonStrategy) {
    super("%nExpecting actual:%n  %s%nto contain only once:%n  %s%n"
          + "but some elements were not found:%n  %s%n"
          + "and others were found more than once:%n  %s%n%s",
          actual, expected, notFound, notOnlyOnce, comparisonStrategy);
  }

  private ShouldContainsOnlyOnce(Object actual, Object expected, Set<?> notFound, ComparisonStrategy comparisonStrategy) {
    super("%nExpecting actual:%n  %s%nto contain only once:%n  %s%nbut some elements were not found:%n  %s%n%s",
          actual, expected, notFound, comparisonStrategy);
  }

  // change the order of parameters to avoid confusion with previous constructor
  private ShouldContainsOnlyOnce(Set<?> notOnlyOnce, Object actual, Object expected,
                                 ComparisonStrategy comparisonStrategy) {
    super("%nExpecting actual:%n  %s%nto contain only once:%n  %s%nbut some elements were found more than once:%n  %s%n%s",
          actual, expected, notOnlyOnce, comparisonStrategy);
  }

}

    if (!isNullOrEmpty(notFound) && !isNullOrEmpty(notOnlyOnce))
      return new ShouldContainsOnlyOnce(actual, expected, notFound, notOnlyOnce, comparisonStrategy);
    if (!isNullOrEmpty(notFound))
      return new ShouldContainsOnlyOnce(actual, expected, notFound, comparisonStrategy);
    // case where no elements were missing but some appeared more than once.
    return new ShouldContainsOnlyOnce(notOnlyOnce, actual, expected, 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