Examples of Unhashables


Examples of com.google.common.collect.testing.SampleElements.Unhashables

public abstract class
    TestUnhashableCollectionGenerator<T extends Collection<UnhashableObject>>
    implements TestCollectionGenerator<UnhashableObject> {
  @Override
  public SampleElements<UnhashableObject> samples() {
    return new Unhashables();
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

public abstract class
    TestUnhashableCollectionGenerator<T extends Collection<UnhashableObject>>
    implements TestCollectionGenerator<UnhashableObject> {
  @Override
  public SampleElements<UnhashableObject> samples() {
    return new Unhashables();
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    assertSame("copyOf(ImmutableListMultimap) should not create a new instance",
        listMultimap, listMultimapCopy);
  }

  public void testUnhashableSingletonValue() {
    SampleElements<UnhashableObject> unhashables = new Unhashables();
    Multimap<Integer, UnhashableObject> multimap = ImmutableMultimap.of(
        0, unhashables.e0());
    assertEquals(1, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    assertEquals(1, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
  }

  public void testUnhashableMixedValues() {
    SampleElements<UnhashableObject> unhashables = new Unhashables();
    Multimap<Integer, Object> multimap = ImmutableMultimap.<Integer, Object>of(
        0, unhashables.e0(), 2, "hey you", 0, unhashables.e1());
    assertEquals(2, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
    assertTrue(multimap.get(0).contains(unhashables.e1()));
    assertTrue(multimap.get(2).contains("hey you"));
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    @Override protected Map<Integer, UnhashableObject> makeEmptyMap() {
      return ImmutableMap.of();
    }

    @Override protected Map<Integer, UnhashableObject> makePopulatedMap() {
      Unhashables unhashables = new Unhashables();
      return ImmutableMap.of(
          0, unhashables.e0(), 1, unhashables.e1(), 2, unhashables.e2());
    }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    @Override protected Integer getKeyNotInPopulatedMap() {
      return 3;
    }

    @Override protected UnhashableObject getValueNotInPopulatedMap() {
      return new Unhashables().e3();
    }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

  @GwtIncompatible("GWT's ImmutableMap emulation is backed by java.util.HashMap.")
  public static class MapTestsWithSingletonUnhashableValue
      extends MapTestsWithUnhashableValues {
    @Override protected Map<Integer, UnhashableObject> makePopulatedMap() {
      Unhashables unhashables = new Unhashables();
      return ImmutableMap.of(0, unhashables.e0());
    }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    assertSame("copyOf(ImmutableListMultimap) should not create a new instance",
        listMultimap, listMultimapCopy);
  }

  public void testUnhashableSingletonValue() {
    SampleElements<UnhashableObject> unhashables = new Unhashables();
    Multimap<Integer, UnhashableObject> multimap = ImmutableMultimap.of(
        0, unhashables.e0());
    assertEquals(1, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    assertEquals(1, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
  }

  public void testUnhashableMixedValues() {
    SampleElements<UnhashableObject> unhashables = new Unhashables();
    Multimap<Integer, Object> multimap = ImmutableMultimap.<Integer, Object>of(
        0, unhashables.e0(), 2, "hey you", 0, unhashables.e1());
    assertEquals(2, multimap.get(0).size());
    assertTrue(multimap.get(0).contains(unhashables.e0()));
    assertTrue(multimap.get(0).contains(unhashables.e1()));
    assertTrue(multimap.get(2).contains("hey you"));
  }
View Full Code Here

Examples of com.google.common.collect.testing.SampleElements.Unhashables

    @Override protected Map<Integer, UnhashableObject> makeEmptyMap() {
      return ImmutableMap.of();
    }

    @Override protected Map<Integer, UnhashableObject> makePopulatedMap() {
      Unhashables unhashables = new Unhashables();
      return ImmutableMap.of(
          0, unhashables.e0, 1, unhashables.e1, 2, unhashables.e2);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.