@GwtCompatible(emulated=true) public class Helpers extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Helpers.NullsBefore
Compares strings in natural order except that null comes immediately before a given value.
|
static class |
Helpers.NullsBeforeB |
static class |
Helpers.NullsBeforeTwo |
Constructor and Description |
---|
Helpers() |
Modifier and Type | Method and Description |
---|---|
static <E> boolean |
addAll(Collection<E> addTo,
Iterable<? extends E> elementsToAdd) |
static void |
assertContentsAnyOrder(Iterable<?> actual,
Object... expected) |
static void |
assertEqualIgnoringOrder(Iterable<?> expected,
Iterable<?> actual) |
static <E> List<E> |
copyToList(E[] elements) |
static <E> List<E> |
copyToList(Iterable<? extends E> elements) |
static <E> Set<E> |
copyToSet(E[] elements) |
static <E> Set<E> |
copyToSet(Iterable<? extends E> elements) |
static <K,V> Comparator<Map.Entry<K,V>> |
entryComparator(Comparator<? super K> keyComparator) |
static Method |
getMethod(Class<?> clazz,
String name) |
static <K,V> Map.Entry<K,V> |
mapEntry(K key,
V value) |
static <T> Collection<T> |
misleadingSizeCollection(int delta)
Returns a collection that simulates concurrent modification by
having its size method return incorrect values.
|
static <K,V> Map.Entry<K,V> |
nefariousMapEntry(K key,
V value)
Returns a "nefarious" map entry with the specified key and value,
meaning an entry that is suitable for testing that map entries cannot be
modified via a nefarious implementation of equals.
|
static <K extends Comparable,V> |
orderEntriesByKey(List<Map.Entry<K,V>> insertionOrder) |
static <T> void |
testComparator(Comparator<? super T> comparator,
List<T> valuesInExpectedOrder) |
static <T> void |
testComparator(Comparator<? super T> comparator,
T... valuesInExpectedOrder) |
static <T extends Comparable<? super T>> |
testCompareToAndEquals(List<T> valuesInExpectedOrder) |
public static <E> List<E> copyToList(E[] elements)
public static <E> Set<E> copyToSet(E[] elements)
public static <K,V> Map.Entry<K,V> mapEntry(K key, V value)
public static void assertEqualIgnoringOrder(Iterable<?> expected, Iterable<?> actual)
public static void assertContentsAnyOrder(Iterable<?> actual, Object... expected)
public static <E> boolean addAll(Collection<E> addTo, Iterable<? extends E> elementsToAdd)
public static <K,V> Comparator<Map.Entry<K,V>> entryComparator(Comparator<? super K> keyComparator)
public static <T> void testComparator(Comparator<? super T> comparator, T... valuesInExpectedOrder)
public static <T> void testComparator(Comparator<? super T> comparator, List<T> valuesInExpectedOrder)
public static <T extends Comparable<? super T>> void testCompareToAndEquals(List<T> valuesInExpectedOrder)
public static <T> Collection<T> misleadingSizeCollection(int delta)
delta
- the difference between the true size of the
collection and the values returned by the size methodpublic static <K,V> Map.Entry<K,V> nefariousMapEntry(K key, V value)
public static <K extends Comparable,V> Iterable<Map.Entry<K,V>> orderEntriesByKey(List<Map.Entry<K,V>> insertionOrder)
Copyright © 2010-2014. All Rights Reserved.