Java 类com.google.common.collect.testing.MinimalSet 实例源码

项目:guava-mock    文件:ImmutableMapTest.java   
@Override protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(),
        entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}",
      map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]",
      map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]",
      map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]",
      map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:googles-monorepo-demo    文件:ImmutableMapTest.java   
@Override protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(),
        entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}",
      map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]",
      map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]",
      map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]",
      map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:miniguava    文件:ImmutableMapTest.java   
@Override protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(),
        entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}",
      map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]",
      map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]",
      map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]",
      map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(new HashSet<K>(map.keySet()), map.keySet());
}
项目:guava-libraries    文件:ImmutableMapTest.java   
@Override protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(),
        entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}",
      map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]",
      map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]",
      map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]",
      map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:guava-libraries    文件:ImmutableMapTest.java   
@Override protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(),
        entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}",
      map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]",
      map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]",
      map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]",
      map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:guava-mock    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherSetWithDifferentElements() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(getSubjectGenerator().samples().e3());

  assertFalse(
      "A Set should not equal another Set containing different elements.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava-mock    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);

  collection = getSubjectGenerator().create(elements.toArray());
  assertTrue(
      "A Set should equal any other Set containing the same elements,"
          + " even if some elements are null.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava-mock    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);
  Set<E> other = MinimalSet.from(elements);

  assertFalse(
      "Two Sets should not be equal if exactly one of them contains null.",
      getSet().equals(other));
}
项目:guava-mock    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_smallerSet() {
  Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(fewerElements)));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherSetWithDifferentElements() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(getSubjectGenerator().samples().e3());

  assertFalse(
      "A Set should not equal another Set containing different elements.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);

  collection = getSubjectGenerator().create(elements.toArray());
  assertTrue(
      "A Set should equal any other Set containing the same elements,"
          + " even if some elements are null.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);
  Set<E> other = MinimalSet.from(elements);

  assertFalse(
      "Two Sets should not be equal if exactly one of them contains null.",
      getSet().equals(other));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_smallerSet() {
  Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(fewerElements)));
}
项目:guava-libraries    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherSetWithDifferentElements() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(getSubjectGenerator().samples().e3());

  assertFalse(
      "A Set should not equal another Set containing different elements.",
      getSet().equals(MinimalSet.from(elements))
  );
}
项目:guava-libraries    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);

  collection = getSubjectGenerator().create(elements.toArray());
  assertTrue("A Set should equal any other Set containing the same elements,"
      + " even if some elements are null.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava-libraries    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);
  Set<E> other = MinimalSet.from(elements);

  assertFalse(
      "Two Sets should not be equal if exactly one of them contains null.",
      getSet().equals(other));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherSetWithDifferentElements() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(getSubjectGenerator().samples().e3());

  assertFalse(
      "A Set should not equal another Set containing different elements.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);

  collection = getSubjectGenerator().create(elements.toArray());
  assertTrue(
      "A Set should equal any other Set containing the same elements,"
          + " even if some elements are null.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);
  Set<E> other = MinimalSet.from(elements);

  assertFalse(
      "Two Sets should not be equal if exactly one of them contains null.",
      getSet().equals(other));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_smallerSet() {
  Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(fewerElements)));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherSetWithDifferentElements() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(getSubjectGenerator().samples().e3());

  assertFalse(
      "A Set should not equal another Set containing different elements.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
@CollectionFeature.Require(ALLOWS_NULL_VALUES)
public void testEquals_containingNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);

  collection = getSubjectGenerator().create(elements.toArray());
  assertTrue(
      "A Set should equal any other Set containing the same elements,"
          + " even if some elements are null.",
      getSet().equals(MinimalSet.from(elements)));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_otherContainsNull() {
  Collection<E> elements = getSampleElements(getNumElements() - 1);
  elements.add(null);
  Set<E> other = MinimalSet.from(elements);

  assertFalse(
      "Two Sets should not be equal if exactly one of them contains null.",
      getSet().equals(other));
}
项目:guava    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_smallerSet() {
  Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(fewerElements)));
}
项目:guava    文件:ImmutableMapTest.java   
@Override
protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(), entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}", map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]", map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]", map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]", map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:guava    文件:ImmutableMapTest.java   
@Override
protected void assertMoreInvariants(Map<K, V> map) {
  // TODO: can these be moved to MapInterfaceTest?
  for (Entry<K, V> entry : map.entrySet()) {
    assertEquals(entry.getKey() + "=" + entry.getValue(), entry.toString());
  }

  assertEquals("{" + joiner.join(map.entrySet()) + "}", map.toString());
  assertEquals("[" + joiner.join(map.entrySet()) + "]", map.entrySet().toString());
  assertEquals("[" + joiner.join(map.keySet()) + "]", map.keySet().toString());
  assertEquals("[" + joiner.join(map.values()) + "]", map.values().toString());

  assertEquals(MinimalSet.from(map.entrySet()), map.entrySet());
  assertEquals(Sets.newHashSet(map.keySet()), map.keySet());
}
项目:guava-mock    文件:ListEqualsTester.java   
public void testEquals_set() {
  assertFalse("A List should never equal a Set.", getList().equals(MinimalSet.from(getList())));
}
项目:guava-mock    文件:SetEqualsTester.java   
public void testEquals_otherSetWithSameElements() {
  assertTrue(
      "A Set should equal any other Set containing the same elements.",
      getSet().equals(MinimalSet.from(getSampleElements())));
}
项目:guava-mock    文件:SetEqualsTester.java   
public void testEquals_largerSet() {
  Collection<E> moreElements = getSampleElements(getNumElements() + 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(moreElements)));
}
项目:googles-monorepo-demo    文件:ListEqualsTester.java   
public void testEquals_set() {
  assertFalse("A List should never equal a Set.", getList().equals(MinimalSet.from(getList())));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
public void testEquals_otherSetWithSameElements() {
  assertTrue(
      "A Set should equal any other Set containing the same elements.",
      getSet().equals(MinimalSet.from(getSampleElements())));
}
项目:googles-monorepo-demo    文件:SetEqualsTester.java   
public void testEquals_largerSet() {
  Collection<E> moreElements = getSampleElements(getNumElements() + 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(moreElements)));
}
项目:guava-libraries    文件:ListEqualsTester.java   
public void testEquals_set() {
  assertFalse("A List should never equal a Set.",
      getList().equals(MinimalSet.from(getList())));
}
项目:guava-libraries    文件:SetEqualsTester.java   
public void testEquals_otherSetWithSameElements() {
  assertTrue(
      "A Set should equal any other Set containing the same elements.",
      getSet().equals(MinimalSet.from(getSampleElements())));
}
项目:guava-libraries    文件:SetEqualsTester.java   
@CollectionSize.Require(absent = CollectionSize.ZERO)
public void testEquals_smallerSet() {
  Collection<E> fewerElements = getSampleElements(getNumElements() - 1);
  assertFalse("Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(fewerElements)));
}
项目:guava-libraries    文件:SetEqualsTester.java   
public void testEquals_largerSet() {
  Collection<E> moreElements = getSampleElements(getNumElements() + 1);
  assertFalse("Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(moreElements)));
}
项目:guava    文件:ListEqualsTester.java   
public void testEquals_set() {
  assertFalse("A List should never equal a Set.", getList().equals(MinimalSet.from(getList())));
}
项目:guava    文件:SetEqualsTester.java   
public void testEquals_otherSetWithSameElements() {
  assertTrue(
      "A Set should equal any other Set containing the same elements.",
      getSet().equals(MinimalSet.from(getSampleElements())));
}
项目:guava    文件:SetEqualsTester.java   
public void testEquals_largerSet() {
  Collection<E> moreElements = getSampleElements(getNumElements() + 1);
  assertFalse(
      "Sets of different sizes should not be equal.",
      getSet().equals(MinimalSet.from(moreElements)));
}
项目:guava    文件:ListEqualsTester.java   
public void testEquals_set() {
  assertFalse("A List should never equal a Set.", getList().equals(MinimalSet.from(getList())));
}