-
Notifications
You must be signed in to change notification settings - Fork 587
/
SynchronizedSortedBagMultimapTest.java
85 lines (73 loc) · 2.93 KB
/
SynchronizedSortedBagMultimapTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright (c) 2022 Shotaro Sano and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.eclipse.collections.impl.multimap.bag.sorted.mutable;
import java.util.Comparator;
import org.eclipse.collections.api.multimap.sortedbag.MutableSortedBagMultimap;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.impl.bag.sorted.mutable.TreeBag;
public class SynchronizedSortedBagMultimapTest extends AbstractMutableSortedBagMultimapTestCase
{
@Override
protected <K, V> MutableSortedBagMultimap<K, V> newMultimap(Comparator<V> comparator)
{
return new SynchronizedSortedBagMultimap<>(TreeBagMultimap.newMultimap(comparator));
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimap()
{
return new SynchronizedSortedBagMultimap<>(TreeBagMultimap.newMultimap());
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimapWithKeyValue(K key, V value)
{
return this.<K, V>newMultimap()
.withKeyValue(key, value);
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimapWithKeysValues(K key1, V value1, K key2, V value2)
{
return this.<K, V>newMultimap()
.withKeyValue(key1, value1)
.withKeyValue(key2, value2);
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimapWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3)
{
return this.<K, V>newMultimap()
.withKeyValue(key1, value1)
.withKeyValue(key2, value2)
.withKeyValue(key3, value3);
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimapWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
{
return this.<K, V>newMultimap()
.withKeyValue(key1, value1)
.withKeyValue(key2, value2)
.withKeyValue(key3, value3)
.withKeyValue(key4, value4);
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimap(Pair<K, V>... pairs)
{
return new SynchronizedSortedBagMultimap<>(TreeBagMultimap.newMultimap(pairs));
}
@Override
public <K, V> MutableSortedBagMultimap<K, V> newMultimapFromPairs(Iterable<Pair<K, V>> inputIterable)
{
return new SynchronizedSortedBagMultimap<>(TreeBagMultimap.newMultimap(inputIterable));
}
@SafeVarargs
@Override
protected final <V> TreeBag<V> createCollection(V... args)
{
return TreeBag.newBagWith(args);
}
}