Package com.google.common.collect.SetsTest

Examples of com.google.common.collect.SetsTest.Derived


  }

  public void testTreeMapDerived() {
    TreeMap<Derived, Integer> map = Maps.newTreeMap();
    assertEquals(Collections.emptyMap(), map);
    map.put(new Derived("foo"), 1);
    map.put(new Derived("bar"), 2);
    assertThat(map.keySet()).containsExactly(
        new Derived("bar"), new Derived("foo")).inOrder();
    assertThat(map.values()).containsExactly(2, 1).inOrder();
    assertNull(map.comparator());
  }
View Full Code Here


  }

  public void testTreeMapDerived() {
    TreeMap<Derived, Integer> map = Maps.newTreeMap();
    assertEquals(Collections.emptyMap(), map);
    map.put(new Derived("foo"), 1);
    map.put(new Derived("bar"), 2);
    assertThat(map.keySet()).containsExactly(
        new Derived("bar"), new Derived("foo")).inOrder();
    assertThat(map.values()).containsExactly(2, 1).inOrder();
    assertNull(map.comparator());
  }
View Full Code Here

  }

  public void testTreeMapDerived() {
    TreeMap<Derived, Integer> map = Maps.newTreeMap();
    assertEquals(Collections.emptyMap(), map);
    map.put(new Derived("foo"), 1);
    map.put(new Derived("bar"), 2);
    JUnitAsserts.assertContentsInOrder(map.keySet(),
        new Derived("bar"), new Derived("foo"));
    JUnitAsserts.assertContentsInOrder(map.values(), 2, 1);
    assertNull(map.comparator());
  }
View Full Code Here

  }

  public void testNewTreeMultisetDerived() {
    TreeMultiset<Derived> set = TreeMultiset.create();
    assertTrue(set.isEmpty());
    set.add(new Derived("foo"), 2);
    set.add(new Derived("bar"), 3);
    JUnitAsserts.assertContentsInOrder(set,
        new Derived("bar"), new Derived("bar"), new Derived("bar"),
        new Derived("foo"), new Derived("foo"));
  }
View Full Code Here

  }

  public void testTreeMultimapDerived() {
    TreeMultimap<Derived, Derived> multimap = TreeMultimap.create();
    assertEquals(ImmutableMultimap.of(), multimap);
    multimap.put(new Derived("foo"), new Derived("f"));
    multimap.put(new Derived("foo"), new Derived("o"));
    multimap.put(new Derived("foo"), new Derived("o"));
    multimap.put(new Derived("bar"), new Derived("b"));
    multimap.put(new Derived("bar"), new Derived("a"));
    multimap.put(new Derived("bar"), new Derived("r"));
    assertContentsInOrder(multimap.keySet(),
        new Derived("bar"), new Derived("foo"));
    assertContentsInOrder(multimap.values(),
        new Derived("a"), new Derived("b"), new Derived("r"),
        new Derived("f"), new Derived("o"));
    assertEquals(Ordering.natural(), multimap.keyComparator());
    assertEquals(Ordering.natural(), multimap.valueComparator());
    SerializableTester.reserializeAndAssert(multimap);
  }
View Full Code Here

  }

  public void testTreeMapDerived() {
    TreeMap<Derived, Integer> map = Maps.newTreeMap();
    assertEquals(Collections.emptyMap(), map);
    map.put(new Derived("foo"), 1);
    map.put(new Derived("bar"), 2);
    ASSERT.that(map.keySet()).hasContentsInOrder(
        new Derived("bar"), new Derived("foo"));
    ASSERT.that(map.values()).hasContentsInOrder(2, 1);
    assertNull(map.comparator());
  }
View Full Code Here

TOP

Related Classes of com.google.common.collect.SetsTest.Derived

Copyright © 2018 www.massapicom. 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.