public final void contains(@Nullable Object element) {
    if (!Iterables.contains(checkNotNull(actual), element)) {
      List<@Nullable Object> elementList = newArrayList(element);
      if (hasMatchingToStringPair(actual, elementList)) {
        failWithoutActual(
            fact("expected to contain", element),
            fact("an instance of", objectToTypeName(element)),
            simpleFact("but did not"),
            fact(
                "though it did contain",
                countDuplicatesAndAddTypeInfo(
                    retainMatchingToString(actual, /* itemsToCheck= */ elementList))),
            fullContents());
      } else {
        failWithActual("expected to contain", element);
      }
    }
  }
@Test
  public void iterableContainsFailsWithSameToString() {
    expectFailureWhenTestingThat(asList(1L, 2L, 3L, 2L)).contains(2);
    assertFailureKeys(
        "expected to contain",
        "an instance of",
        "but did not",
        "though it did contain",
        "full contents");
    assertFailureValue("expected to contain", "2");
    assertFailureValue("an instance of", "java.lang.Integer");
    assertFailureValue("though it did contain", "[2 [2 copies]] (java.lang.Long)");
    assertFailureValue("full contents", "[1, 2, 3, 2]");
  }