Home
last modified time | relevance | path

Searched refs:multimap (Results 1 – 25 of 189) sorted by relevance

12345678

/external/guava/guava-tests/test/com/google/common/collect/
DLinkedHashMultimapTest.java64 SetMultimap<String, String> multimap = LinkedHashMultimap.create(); in suite()
66 multimap.put(entry.getKey(), entry.getValue()); in suite()
68 return multimap; in suite()
88 LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create(); in testValueSetHashTableExpansion() local
90 multimap.put("a", z); in testValueSetHashTableExpansion()
94 (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a"); in testValueSetHashTableExpansion()
102 Multimap<String, Integer> multimap = LinkedHashMultimap.create(); in initializeMultimap5() local
103 multimap.put("foo", 5); in initializeMultimap5()
104 multimap.put("bar", 4); in initializeMultimap5()
105 multimap.put("foo", 3); in initializeMultimap5()
[all …]
DImmutableSetMultimapTest.java74 ImmutableSetMultimap<String, Integer> multimap = new Builder<String, Integer>() in testBuilder_withImmutableEntry() local
77 assertEquals(ImmutableSet.of(1), multimap.get("one")); in testBuilder_withImmutableEntry()
123 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllIterable() local
124 assertEquals(ImmutableSet.of(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllIterable()
125 assertEquals(ImmutableSet.of(4, 5), multimap.get("bar")); in testBuilderPutAllIterable()
126 assertEquals(7, multimap.size()); in testBuilderPutAllIterable()
135 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllVarargs() local
136 assertEquals(ImmutableSet.of(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllVarargs()
137 assertEquals(ImmutableSet.of(4, 5), multimap.get("bar")); in testBuilderPutAllVarargs()
138 assertEquals(7, multimap.size()); in testBuilderPutAllVarargs()
[all …]
DArrayListMultimapTest.java53 ListMultimap<String, String> multimap = ArrayListMultimap.create(); in suite()
55 multimap.put(entry.getKey(), entry.getValue()); in suite()
57 return multimap; in suite()
83 Multimap<String, Integer> multimap = create(); in testGetRandomAccess() local
84 multimap.put("foo", 1); in testGetRandomAccess()
85 multimap.put("foo", 3); in testGetRandomAccess()
86 assertTrue(multimap.get("foo") instanceof RandomAccess); in testGetRandomAccess()
87 assertTrue(multimap.get("bar") instanceof RandomAccess); in testGetRandomAccess()
94 Multimap<String, Integer> multimap = create(); in testRemoveAllRandomAccess() local
95 multimap.put("foo", 1); in testRemoveAllRandomAccess()
[all …]
DTreeMultimapNaturalTest.java62 SetMultimap<String, String> multimap = TreeMultimap.create( in suite()
65 multimap.put(entry.getKey(), entry.getValue()); in suite()
67 return multimap; in suite()
108 TreeMultimap<String, Integer> multimap = TreeMultimap.create(); in createPopulate() local
109 multimap.put("google", 2); in createPopulate()
110 multimap.put("google", 6); in createPopulate()
111 multimap.put("foo", 3); in createPopulate()
112 multimap.put("foo", 1); in createPopulate()
113 multimap.put("foo", 7); in createPopulate()
114 multimap.put("tree", 4); in createPopulate()
[all …]
DImmutableListMultimapTest.java76 ImmutableListMultimap<String, Integer> multimap = new Builder<String, Integer>() in testBuilder_withImmutableEntry() local
79 assertEquals(Arrays.asList(1), multimap.get("one")); in testBuilder_withImmutableEntry()
125 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllIterable() local
126 assertEquals(Arrays.asList(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllIterable()
127 assertEquals(Arrays.asList(4, 5), multimap.get("bar")); in testBuilderPutAllIterable()
128 assertEquals(7, multimap.size()); in testBuilderPutAllIterable()
137 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllVarargs() local
138 assertEquals(Arrays.asList(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllVarargs()
139 assertEquals(Arrays.asList(4, 5), multimap.get("bar")); in testBuilderPutAllVarargs()
140 assertEquals(7, multimap.size()); in testBuilderPutAllVarargs()
[all …]
DLinkedListMultimapTest.java68 ListMultimap<String, String> multimap = LinkedListMultimap.create(); in suite()
70 multimap.put(entry.getKey(), entry.getValue()); in suite()
72 return multimap; in suite()
98 Multimap<String, Integer> multimap = create(); in testGetRandomAccess() local
99 multimap.put("foo", 1); in testGetRandomAccess()
100 multimap.put("foo", 3); in testGetRandomAccess()
101 assertFalse(multimap.get("foo") instanceof RandomAccess); in testGetRandomAccess()
102 assertFalse(multimap.get("bar") instanceof RandomAccess); in testGetRandomAccess()
110 Multimap<String, Integer> multimap = create(); in testRemoveAllRandomAccess() local
111 multimap.put("foo", 1); in testRemoveAllRandomAccess()
[all …]
DTreeMultimapExplicitTest.java80 TreeMultimap<String, Integer> multimap = TreeMultimap.create( in createPopulate() local
82 multimap.put("google", 2); in createPopulate()
83 multimap.put("google", 6); in createPopulate()
84 multimap.put(null, 3); in createPopulate()
85 multimap.put(null, 1); in createPopulate()
86 multimap.put(null, 7); in createPopulate()
87 multimap.put("tree", 0); in createPopulate()
88 multimap.put("tree", null); in createPopulate()
89 return multimap; in createPopulate()
115 Multimap<String, Integer> multimap = create(); in testToString() local
[all …]
DMultimapsTest.java135 ListMultimap<String, Integer> multimap in testUnmodifiableArrayListMultimapRandomAccess() local
137 assertTrue(multimap.get("foo") instanceof RandomAccess); in testUnmodifiableArrayListMultimapRandomAccess()
138 assertTrue(multimap.get("bar") instanceof RandomAccess); in testUnmodifiableArrayListMultimapRandomAccess()
145 ListMultimap<String, Integer> multimap in testUnmodifiableLinkedListMultimapRandomAccess() local
147 assertFalse(multimap.get("foo") instanceof RandomAccess); in testUnmodifiableLinkedListMultimapRandomAccess()
148 assertFalse(multimap.get("bar") instanceof RandomAccess); in testUnmodifiableLinkedListMultimapRandomAccess()
208 SortedSetMultimap<String, Integer> multimap in testUnmodifiableSynchronizedTreeMultimap() local
210 checkUnmodifiableMultimap(multimap, false, "null", 42); in testUnmodifiableSynchronizedTreeMultimap()
211 assertSame(INT_COMPARATOR, multimap.valueComparator()); in testUnmodifiableSynchronizedTreeMultimap()
218 SortedSetMultimap<String, Integer> multimap = in testSerializingUnmodifiableSynchronizedTreeMultimap() local
[all …]
DMultimapsCollectionTest.java100 Multimap<Integer, String> multimap, String[] elements) { in populateMultimapForGet() argument
101 multimap.put(2, "foo"); in populateMultimapForGet()
103 multimap.put(3, element); in populateMultimapForGet()
108 Multimap<String, Integer> multimap, String[] elements) { in populateMultimapForKeySet() argument
110 multimap.put(element, 2); in populateMultimapForKeySet()
111 multimap.put(element, 3); in populateMultimapForKeySet()
116 Multimap<Integer, String> multimap, String[] elements) { in populateMultimapForValues() argument
118 multimap.put(i % 2, elements[i]); in populateMultimapForValues()
123 Multimap<String, Integer> multimap, String[] elements) { in populateMultimapForKeys() argument
125 multimap.put(elements[i], i); in populateMultimapForKeys()
[all …]
DHashMultimapTest.java47 SetMultimap<String, String> multimap = HashMultimap.create(); in suite()
49 multimap.put(entry.getKey(), entry.getValue()); in suite()
51 return multimap; in suite()
74 HashMultimap<String, Integer> multimap = HashMultimap.create(); in testCreate() local
75 multimap.put("foo", 1); in testCreate()
76 multimap.put("bar", 2); in testCreate()
77 multimap.put("foo", 3); in testCreate()
78 assertEquals(ImmutableSet.of(1, 3), multimap.get("foo")); in testCreate()
79 assertEquals(2, multimap.expectedValuesPerKey); in testCreate()
83 HashMultimap<String, Integer> multimap = HashMultimap.create(); in testCreateFromMultimap() local
[all …]
DMapConstraintsTest.java212 Multimap<String, Integer> multimap = LinkedListMultimap.create(); in testConstrainedMultimapLegal() local
214 multimap, TEST_CONSTRAINT); in testConstrainedMultimapLegal()
215 multimap.put(TEST_KEY, TEST_VALUE); in testConstrainedMultimapLegal()
217 multimap.get("bar").add(2); in testConstrainedMultimapLegal()
219 multimap.get("qux").addAll(Arrays.asList(4)); in testConstrainedMultimapLegal()
221 multimap.putAll("zag", Arrays.asList(6)); in testConstrainedMultimapLegal()
223 multimap.putAll(new ImmutableMultimap.Builder<String, Integer>() in testConstrainedMultimapLegal()
227 multimap.putAll(new ImmutableMultimap.Builder<String, Integer>() in testConstrainedMultimapLegal()
231 assertTrue(multimap.equals(constrained)); in testConstrainedMultimapLegal()
232 assertTrue(constrained.equals(multimap)); in testConstrainedMultimapLegal()
[all …]
/external/guava/guava-gwt/test-super/com/google/common/collect/super/com/google/common/collect/
DLinkedHashMultimapTest.java41 LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create(); in testValueSetHashTableExpansion() local
43 multimap.put("a", z); in testValueSetHashTableExpansion()
47 (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a"); in testValueSetHashTableExpansion()
55 Multimap<String, Integer> multimap = LinkedHashMultimap.create(); in initializeMultimap5() local
56 multimap.put("foo", 5); in initializeMultimap5()
57 multimap.put("bar", 4); in initializeMultimap5()
58 multimap.put("foo", 3); in initializeMultimap5()
59 multimap.put("cow", 2); in initializeMultimap5()
60 multimap.put("bar", 1); in initializeMultimap5()
61 return multimap; in initializeMultimap5()
[all …]
DArrayListMultimapTest.java46 Multimap<String, Integer> multimap = create(); in testGetRandomAccess() local
47 multimap.put("foo", 1); in testGetRandomAccess()
48 multimap.put("foo", 3); in testGetRandomAccess()
49 assertTrue(multimap.get("foo") instanceof RandomAccess); in testGetRandomAccess()
50 assertTrue(multimap.get("bar") instanceof RandomAccess); in testGetRandomAccess()
57 Multimap<String, Integer> multimap = create(); in testRemoveAllRandomAccess() local
58 multimap.put("foo", 1); in testRemoveAllRandomAccess()
59 multimap.put("foo", 3); in testRemoveAllRandomAccess()
60 assertTrue(multimap.removeAll("foo") instanceof RandomAccess); in testRemoveAllRandomAccess()
61 assertTrue(multimap.removeAll("bar") instanceof RandomAccess); in testRemoveAllRandomAccess()
[all …]
DImmutableSetMultimapTest.java41 ImmutableSetMultimap<String, Integer> multimap = new Builder<String, Integer>() in testBuilder_withImmutableEntry() local
44 assertEquals(ImmutableSet.of(1), multimap.get("one")); in testBuilder_withImmutableEntry()
90 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllIterable() local
91 assertEquals(ImmutableSet.of(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllIterable()
92 assertEquals(ImmutableSet.of(4, 5), multimap.get("bar")); in testBuilderPutAllIterable()
93 assertEquals(7, multimap.size()); in testBuilderPutAllIterable()
102 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllVarargs() local
103 assertEquals(ImmutableSet.of(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllVarargs()
104 assertEquals(ImmutableSet.of(4, 5), multimap.get("bar")); in testBuilderPutAllVarargs()
105 assertEquals(7, multimap.size()); in testBuilderPutAllVarargs()
[all …]
DImmutableListMultimapTest.java52 ImmutableListMultimap<String, Integer> multimap = new Builder<String, Integer>() in testBuilder_withImmutableEntry() local
55 assertEquals(Arrays.asList(1), multimap.get("one")); in testBuilder_withImmutableEntry()
101 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllIterable() local
102 assertEquals(Arrays.asList(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllIterable()
103 assertEquals(Arrays.asList(4, 5), multimap.get("bar")); in testBuilderPutAllIterable()
104 assertEquals(7, multimap.size()); in testBuilderPutAllIterable()
113 Multimap<String, Integer> multimap = builder.build(); in testBuilderPutAllVarargs() local
114 assertEquals(Arrays.asList(1, 2, 3, 6, 7), multimap.get("foo")); in testBuilderPutAllVarargs()
115 assertEquals(Arrays.asList(4, 5), multimap.get("bar")); in testBuilderPutAllVarargs()
116 assertEquals(7, multimap.size()); in testBuilderPutAllVarargs()
[all …]
DTreeMultimapNaturalTest.java50 TreeMultimap<String, Integer> multimap = TreeMultimap.create(); in createPopulate() local
51 multimap.put("google", 2); in createPopulate()
52 multimap.put("google", 6); in createPopulate()
53 multimap.put("foo", 3); in createPopulate()
54 multimap.put("foo", 1); in createPopulate()
55 multimap.put("foo", 7); in createPopulate()
56 multimap.put("tree", 4); in createPopulate()
57 multimap.put("tree", 0); in createPopulate()
58 return multimap; in createPopulate()
62 SetMultimap<String, Integer> multimap = create(); in testToString() local
[all …]
DTreeMultimapExplicitTest.java78 TreeMultimap<String, Integer> multimap = TreeMultimap.create( in createPopulate() local
80 multimap.put("google", 2); in createPopulate()
81 multimap.put("google", 6); in createPopulate()
82 multimap.put(null, 3); in createPopulate()
83 multimap.put(null, 1); in createPopulate()
84 multimap.put(null, 7); in createPopulate()
85 multimap.put("tree", 0); in createPopulate()
86 multimap.put("tree", null); in createPopulate()
87 return multimap; in createPopulate()
113 Multimap<String, Integer> multimap = create(); in testToString() local
[all …]
DMultimapsTest.java118 ListMultimap<String, Integer> multimap in testUnmodifiableArrayListMultimapRandomAccess() local
120 assertTrue(multimap.get("foo") instanceof RandomAccess); in testUnmodifiableArrayListMultimapRandomAccess()
121 assertTrue(multimap.get("bar") instanceof RandomAccess); in testUnmodifiableArrayListMultimapRandomAccess()
128 ListMultimap<String, Integer> multimap in testUnmodifiableLinkedListMultimapRandomAccess() local
130 assertFalse(multimap.get("foo") instanceof RandomAccess); in testUnmodifiableLinkedListMultimapRandomAccess()
131 assertFalse(multimap.get("bar") instanceof RandomAccess); in testUnmodifiableLinkedListMultimapRandomAccess()
174 Multimap<String, Integer> multimap, boolean permitsDuplicates) { in checkUnmodifiableMultimap() argument
175 checkUnmodifiableMultimap(multimap, permitsDuplicates, null, null); in checkUnmodifiableMultimap()
184 Multimap<String, Integer> multimap, boolean permitsDuplicates, in checkUnmodifiableMultimap() argument
187 prepareUnmodifiableTests(multimap, permitsDuplicates, nullKey, nullValue); in checkUnmodifiableMultimap()
[all …]
DHashMultimapTest.java36 HashMultimap<String, Integer> multimap = HashMultimap.create(); in testCreate() local
37 multimap.put("foo", 1); in testCreate()
38 multimap.put("bar", 2); in testCreate()
39 multimap.put("foo", 3); in testCreate()
40 assertEquals(ImmutableSet.of(1, 3), multimap.get("foo")); in testCreate()
41 assertEquals(2, multimap.expectedValuesPerKey); in testCreate()
45 HashMultimap<String, Integer> multimap = HashMultimap.create(); in testCreateFromMultimap() local
46 multimap.put("foo", 1); in testCreateFromMultimap()
47 multimap.put("bar", 2); in testCreateFromMultimap()
48 multimap.put("foo", 3); in testCreateFromMultimap()
[all …]
DMapConstraintsTest.java210 Multimap<String, Integer> multimap = LinkedListMultimap.create(); in testConstrainedMultimapLegal() local
212 multimap, TEST_CONSTRAINT); in testConstrainedMultimapLegal()
213 multimap.put(TEST_KEY, TEST_VALUE); in testConstrainedMultimapLegal()
215 multimap.get("bar").add(2); in testConstrainedMultimapLegal()
217 multimap.get("qux").addAll(Arrays.asList(4)); in testConstrainedMultimapLegal()
219 multimap.putAll("zag", Arrays.asList(6)); in testConstrainedMultimapLegal()
221 multimap.putAll(new ImmutableMultimap.Builder<String, Integer>() in testConstrainedMultimapLegal()
225 multimap.putAll(new ImmutableMultimap.Builder<String, Integer>() in testConstrainedMultimapLegal()
229 assertTrue(multimap.equals(constrained)); in testConstrainedMultimapLegal()
230 assertTrue(constrained.equals(multimap)); in testConstrainedMultimapLegal()
[all …]
DLinkedListMultimapTest.java51 Multimap<String, Integer> multimap = create(); in testGetRandomAccess() local
52 multimap.put("foo", 1); in testGetRandomAccess()
53 multimap.put("foo", 3); in testGetRandomAccess()
54 assertFalse(multimap.get("foo") instanceof RandomAccess); in testGetRandomAccess()
55 assertFalse(multimap.get("bar") instanceof RandomAccess); in testGetRandomAccess()
63 Multimap<String, Integer> multimap = create(); in testRemoveAllRandomAccess() local
64 multimap.put("foo", 1); in testRemoveAllRandomAccess()
65 multimap.put("foo", 3); in testRemoveAllRandomAccess()
66 assertTrue(multimap.removeAll("foo") instanceof RandomAccess); in testRemoveAllRandomAccess()
67 assertTrue(multimap.removeAll("bar") instanceof RandomAccess); in testRemoveAllRandomAccess()
[all …]
/external/guava/guava-testlib/src/com/google/common/collect/testing/google/
DUnmodifiableCollectionTests.java270 Multimap<K, V> multimap, final K sampleKey, final V sampleValue) { in assertMultimapIsUnmodifiable() argument
272 Collections.unmodifiableList(Lists.newArrayList(multimap.entries())); in assertMultimapIsUnmodifiable()
274 assertMultimapRemainsUnmodified(multimap, originalEntries); in assertMultimapIsUnmodifiable()
280 multimap.clear(); in assertMultimapIsUnmodifiable()
285 assertMultimapRemainsUnmodified(multimap, originalEntries); in assertMultimapIsUnmodifiable()
289 multimap.asMap().entrySet(), in assertMultimapIsUnmodifiable()
294 assertMultimapRemainsUnmodified(multimap, originalEntries); in assertMultimapIsUnmodifiable()
295 if (!multimap.isEmpty()) { in assertMultimapIsUnmodifiable()
297 multimap.asMap().entrySet().iterator().next().getValue(); in assertMultimapIsUnmodifiable()
304 multimap.entries(), in assertMultimapIsUnmodifiable()
[all …]
DMultimapClearTester.java43 multimap().clear(); in testClearUnsupported()
49 assertEquals(0, multimap().size()); in assertCleared()
50 assertTrue(multimap().isEmpty()); in assertCleared()
51 assertEquals(multimap(), getSubjectGenerator().create()); in assertCleared()
52 ASSERT.that(multimap().entries()).isEmpty(); in assertCleared()
53 ASSERT.that(multimap().asMap()).isEmpty(); in assertCleared()
54 ASSERT.that(multimap().keySet()).isEmpty(); in assertCleared()
55 ASSERT.that(multimap().keys()).isEmpty(); in assertCleared()
56 ASSERT.that(multimap().values()).isEmpty(); in assertCleared()
64 multimap().clear(); in testClear()
[all …]
DMultimapPutTester.java48 multimap().put(sampleKeys().e3, sampleValues().e3); in testPutUnsupported()
62 assertTrue(multimap().put(key, value)); in testPutEmpty()
65 assertEquals(size + 1, multimap().size()); in testPutEmpty()
79 assertTrue(multimap().put(key, newValue)); in testPutPresent()
82 assertEquals(size + 1, multimap().size()); in testPutPresent()
93 List<V> values = Helpers.copyToList(multimap().get(key)); in testPutTwoElements()
95 assertTrue(multimap().put(key, v1)); in testPutTwoElements()
96 assertTrue(multimap().put(key, v2)); in testPutTwoElements()
102 assertEquals(size + 2, multimap().size()); in testPutTwoElements()
109 multimap().put(sampleKeys().e3, null); in testPutNullValue_supported()
[all …]
DMultimapSizeTester.java42 Multimap<K, V> multimap = multimap(); in testSize() local
43 assertEquals(expectedSize, multimap.size()); in testSize()
46 for (Entry<K, V> entry : multimap.entries()) { in testSize()
47 assertTrue(multimap.containsEntry(entry.getKey(), entry.getValue())); in testSize()
53 for (Entry<K, Collection<V>> entry2 : multimap.asMap().entrySet()) { in testSize()
61 assertTrue(multimap().isEmpty()); in testIsEmptyYes()
66 assertFalse(multimap().isEmpty()); in testIsEmptyNo()
73 assertEquals(getNumElements(), multimap().size()); in testSizeNullKey()
74 assertFalse(multimap().isEmpty()); in testSizeNullKey()
81 assertEquals(getNumElements(), multimap().size()); in testSizeNullValue()
[all …]

12345678