class ShouldContainEntries extends BasicErrorMessageFactory {

  public static <K, V> ErrorMessageFactory shouldContainEntries(Map<? extends K, ? extends V> actual,
                                                                Entry<? extends K, ? extends V>[] expectedEntries,
                                                                Set<Entry<? extends K, ? extends V>> entriesWithWrongValue,
                                                                Set<Entry<? extends K, ? extends V>> entriesWithKeyNotFound,
                                                                Representation representation) {<FILL_FUNCTION_BODY>}

  private static <K, V> List<String> buildValueDifferences(Map<? extends K, ? extends V> actual,
                                                           Set<Entry<? extends K, ? extends V>> entriesWithWrongValues,
                                                           Representation representation) {
    return entriesWithWrongValues.stream()
                                 .map(entryWithWrongValue -> valueDifference(actual, entryWithWrongValue, representation))
                                 .collect(toList());
  }

  private static <K, V> String valueDifference(Map<? extends K, ? extends V> actual,
                                               Entry<? extends K, ? extends V> entryWithWrongValue,
                                               Representation representation) {
    K key = entryWithWrongValue.getKey();
    MapEntry<K, ? extends V> actualEntry = entry(key, actual.get(key));
    V expectedValue = entryWithWrongValue.getValue();
    return escapePercent(format("%s (expected: %s)", representation.toStringOf(actualEntry),
                                representation.toStringOf(expectedValue)));
  }

  private <K, V> ShouldContainEntries(Map<? extends K, ? extends V> actual,
                                      Entry<? extends K, ? extends V>[] expectedEntries,
                                      Set<Entry<? extends K, ? extends V>> notFound) {
    super("%nExpecting map:%n" +
          "  %s%n" +
          "to contain entries:%n" +
          "  %s%n" +
          "but could not find the following map entries:%n" +
          "  %s",
          actual, expectedEntries, notFound);
  }

  private <K, V> ShouldContainEntries(Map<? extends K, ? extends V> actual,
                                      Entry<? extends K, ? extends V>[] expectedEntries,
                                      List<String> valueDifferences) {
    super("%nExpecting map:%n" +
          "  %s%n" +
          "to contain entries:%n" +
          "  %s%n" +
          "but the following map entries had different values:%n" +
          "  " + valueDifferences,
          actual, expectedEntries, valueDifferences);
  }

  private <K, V> ShouldContainEntries(Map<? extends K, ? extends V> actual,
                                      Entry<? extends K, ? extends V>[] expectedEntries,
                                      Set<Entry<? extends K, ? extends V>> keysNotFound,
                                      List<String> valueDifferences) {
    super("%nExpecting map:%n" +
          "  %s%n" +
          "to contain entries:%n" +
          "  %s%n" +
          "but could not find the following map entries:%n" +
          "  %s%n" +
          "and the following map entries had different values:%n" +
          "  " + valueDifferences,
          actual, expectedEntries, keysNotFound);
  }

}

    if (entriesWithWrongValue.isEmpty()) return new ShouldContainEntries(actual, expectedEntries, entriesWithKeyNotFound);
    if (entriesWithKeyNotFound.isEmpty())
      return new ShouldContainEntries(actual, expectedEntries,
                                      buildValueDifferences(actual, entriesWithWrongValue, representation));
    // mix of missing keys and keys with different values
    return new ShouldContainEntries(actual, expectedEntries, entriesWithKeyNotFound,
                                    buildValueDifferences(actual, entriesWithWrongValue, representation));
  
<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