Remove noisy inline comments.
This commit is contained in:
parent
fecc3b3c34
commit
1e0646ee8d
|
@ -70,9 +70,6 @@ public class FluentIterable<E> implements Iterable<E> {
|
|||
/** A reference to the wrapped iterable. */
|
||||
private final Iterable<E> iterable;
|
||||
|
||||
// Static factory methods
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Creates a new empty FluentIterable.
|
||||
*
|
||||
|
@ -130,9 +127,6 @@ public class FluentIterable<E> implements Iterable<E> {
|
|||
return new FluentIterable<>(iterable);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Don't allow instances.
|
||||
*/
|
||||
|
@ -148,9 +142,6 @@ public class FluentIterable<E> implements Iterable<E> {
|
|||
this.iterable = iterable;
|
||||
}
|
||||
|
||||
// fluent construction methods
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a new FluentIterable whose iterator will first traverse
|
||||
* the elements of the current iterable, followed by the provided
|
||||
|
@ -357,9 +348,6 @@ public class FluentIterable<E> implements Iterable<E> {
|
|||
return of(IterableUtils.zippingIterable(iterable, others));
|
||||
}
|
||||
|
||||
// convenience methods
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
|
|
|
@ -61,9 +61,6 @@ public class IterableUtils {
|
|||
}
|
||||
};
|
||||
|
||||
// Empty
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Gets an empty iterable.
|
||||
* <p>
|
||||
|
@ -77,9 +74,6 @@ public class IterableUtils {
|
|||
return EMPTY_ITERABLE;
|
||||
}
|
||||
|
||||
// Chained
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Combines two iterables into a single iterable.
|
||||
* <p>
|
||||
|
@ -185,9 +179,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Collated
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Combines the two provided iterables into an ordered iterable using
|
||||
* natural ordering.
|
||||
|
@ -240,9 +231,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Filtered
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a view of the given iterable that only contains elements matching
|
||||
* the provided predicate.
|
||||
|
@ -268,9 +256,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Bounded
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a view of the given iterable that contains at most the given number
|
||||
* of elements.
|
||||
|
@ -299,9 +284,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Looping
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a view of the given iterable which will cycle infinitely over
|
||||
* its elements.
|
||||
|
@ -335,9 +317,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Reversed
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a reversed view of the given iterable.
|
||||
* <p>
|
||||
|
@ -367,9 +346,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Skipping
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a view of the given iterable that skips the first N elements.
|
||||
* <p>
|
||||
|
@ -397,9 +373,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Transformed
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a transformed view of the given iterable where all of its elements
|
||||
* have been transformed by the provided transformer.
|
||||
|
@ -426,9 +399,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Unique
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a unique view of the given iterable.
|
||||
* <p>
|
||||
|
@ -451,9 +421,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Unmodifiable
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable view of the given iterable.
|
||||
* <p>
|
||||
|
@ -488,9 +455,6 @@ public class IterableUtils {
|
|||
}
|
||||
}
|
||||
|
||||
// Zipping
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Interleaves two iterables into a single iterable.
|
||||
* <p>
|
||||
|
@ -554,9 +518,6 @@ public class IterableUtils {
|
|||
};
|
||||
}
|
||||
|
||||
// Utility methods
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns an immutable empty iterable if the argument is null,
|
||||
* or the argument itself otherwise.
|
||||
|
@ -1044,9 +1005,6 @@ public class IterableUtils {
|
|||
transformer, delimiter, prefix, suffix);
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Fail-fast check for null arguments.
|
||||
*
|
||||
|
|
|
@ -274,8 +274,6 @@ public class MapUtils {
|
|||
return applyDefaultFunction(map, key, MapUtils::getBoolean, defaultFunction);
|
||||
}
|
||||
|
||||
// Type safe primitive getters
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets a boolean from a Map in a null-safe manner.
|
||||
* <p>
|
||||
|
@ -294,8 +292,6 @@ public class MapUtils {
|
|||
return Boolean.TRUE.equals(getBoolean(map, key));
|
||||
}
|
||||
|
||||
// Type safe primitive getters with default values
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets a boolean from a Map in a null-safe manner, using the default value if the conversion fails.
|
||||
* <p>
|
||||
|
@ -979,7 +975,6 @@ public class MapUtils {
|
|||
return applyDefaultValue(map, key, MapUtils::getNumber, defaultValue);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets from a Map in a null-safe manner.
|
||||
*
|
||||
|
@ -996,7 +991,6 @@ public class MapUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Looks up the given key in the given map, converting null into the given default value.
|
||||
*
|
||||
|
@ -1175,8 +1169,6 @@ public class MapUtils {
|
|||
return applyDefaultValue(map, key, MapUtils::getString, defaultValue);
|
||||
}
|
||||
|
||||
// Misc
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Inverts the supplied map returning a new HashMap such that the keys of the input are swapped with the values.
|
||||
* <p>
|
||||
|
@ -1298,8 +1290,6 @@ public class MapUtils {
|
|||
return LazyMap.lazyMap(map, factory);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a "lazy" map whose values will be created on demand.
|
||||
* <p>
|
||||
|
@ -1623,7 +1613,6 @@ public class MapUtils {
|
|||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Puts all the keys and values from the specified array into the map.
|
||||
* <p>
|
||||
|
@ -1745,7 +1734,6 @@ public class MapUtils {
|
|||
return map == null ? 0 : map.size();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns a synchronized map backed by the given map.
|
||||
* <p>
|
||||
|
@ -1776,7 +1764,6 @@ public class MapUtils {
|
|||
return Collections.synchronizedMap(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns a synchronized sorted map backed by the given sorted map.
|
||||
* <p>
|
||||
|
@ -1829,7 +1816,6 @@ public class MapUtils {
|
|||
return map;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets a new Properties object initialized with the values from a Map. A null input will return an empty properties
|
||||
* object.
|
||||
|
@ -1947,8 +1933,6 @@ public class MapUtils {
|
|||
return UnmodifiableSortedMap.unmodifiableSortedMap(map);
|
||||
}
|
||||
|
||||
// Printing methods
|
||||
// -------------------------------------------------------------------------
|
||||
/**
|
||||
* Prints the given map with nice line breaks.
|
||||
* <p>
|
||||
|
|
|
@ -95,9 +95,6 @@ public class MultiMapUtils {
|
|||
return map == null || map.isEmpty();
|
||||
}
|
||||
|
||||
// Null safe getters
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Gets a Collection from {@code MultiValuedMap} in a null-safe manner.
|
||||
*
|
||||
|
@ -177,9 +174,6 @@ public class MultiMapUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
// Factory Methods
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Creates a {@link ListValuedMap} with an {@link java.util.ArrayList ArrayList} as
|
||||
* collection class to store the values mapped to a key.
|
||||
|
@ -204,9 +198,6 @@ public class MultiMapUtils {
|
|||
return new HashSetValuedHashMap<>();
|
||||
}
|
||||
|
||||
// MultiValuedMap Decorators
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns an {@code UnmodifiableMultiValuedMap} backed by the given
|
||||
* map.
|
||||
|
|
|
@ -75,9 +75,6 @@ public class PredicateUtils {
|
|||
*/
|
||||
private PredicateUtils() {}
|
||||
|
||||
// Simple predicates
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Gets a Predicate that always throws an exception.
|
||||
* This could be useful during testing as a placeholder.
|
||||
|
@ -238,9 +235,6 @@ public class PredicateUtils {
|
|||
return asPredicate(InvokerTransformer.<Object, Boolean>invokerTransformer(methodName, paramTypes, args));
|
||||
}
|
||||
|
||||
// Boolean combinations
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a new Predicate that returns true only if both of the specified
|
||||
* predicates are true.
|
||||
|
@ -451,9 +445,6 @@ public class PredicateUtils {
|
|||
return NotPredicate.notPredicate(predicate);
|
||||
}
|
||||
|
||||
// Adaptors
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a new Predicate that wraps a Transformer. The Transformer must
|
||||
* return either Boolean.TRUE or Boolean.FALSE otherwise a PredicateException
|
||||
|
@ -469,9 +460,6 @@ public class PredicateUtils {
|
|||
return TransformerPredicate.transformerPredicate(transformer);
|
||||
}
|
||||
|
||||
// Null handlers
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Gets a Predicate that throws an exception if the input object is null,
|
||||
* otherwise it calls the specified Predicate. This allows null handling
|
||||
|
|
|
@ -2015,7 +2015,6 @@ public class TreeBidiMap<K extends Comparable<K>, V extends Comparable<V>>
|
|||
&& parentNode[dataElement.ordinal()].rightNode[dataElement.ordinal()] == this;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the key.
|
||||
*
|
||||
|
|
|
@ -212,7 +212,6 @@ public class PredicatedCollection<E> extends AbstractCollectionDecorator<E> {
|
|||
/** The buffer containing rejected elements. */
|
||||
private final List<E> rejected = new ArrayList<>();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs a PredicatedCollectionBuilder with the specified Predicate.
|
||||
*
|
||||
|
|
|
@ -46,8 +46,6 @@ public class ArrayIterator<E> implements ResettableIterator<E> {
|
|||
/** The current iterator index */
|
||||
int index;
|
||||
|
||||
// Constructors
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs an ArrayIterator that will iterate over the values in the
|
||||
* specified array.
|
||||
|
|
|
@ -50,8 +50,6 @@ public class ArrayListIterator<E> extends ArrayIterator<E>
|
|||
*/
|
||||
private int lastItemIndex = -1;
|
||||
|
||||
// Constructors
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs an ArrayListIterator that will iterate over the values in the
|
||||
* specified array.
|
||||
|
|
|
@ -59,8 +59,6 @@ public class CollatingIterator<E> implements Iterator<E> {
|
|||
*/
|
||||
private int lastReturned = -1;
|
||||
|
||||
// Constructors
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs a new {@code CollatingIterator}. A comparator must be
|
||||
* set by calling {@link #setComparator(Comparator)} before invoking
|
||||
|
@ -154,8 +152,6 @@ public class CollatingIterator<E> implements Iterator<E> {
|
|||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
// ----------------------------------------------------------------------
|
||||
/**
|
||||
* Adds the given {@link Iterator} to the iterators being collated.
|
||||
*
|
||||
|
@ -217,8 +213,6 @@ public class CollatingIterator<E> implements Iterator<E> {
|
|||
comparator = comp;
|
||||
}
|
||||
|
||||
// Iterator Methods
|
||||
// -------------------------------------------------------------------
|
||||
/**
|
||||
* Returns {@code true} if any child iterator has remaining elements.
|
||||
*
|
||||
|
@ -279,8 +273,6 @@ public class CollatingIterator<E> implements Iterator<E> {
|
|||
return lastReturned;
|
||||
}
|
||||
|
||||
// Private Methods
|
||||
// -------------------------------------------------------------------
|
||||
/**
|
||||
* Initializes the collating state if it hasn't been already.
|
||||
*/
|
||||
|
|
|
@ -48,9 +48,6 @@ public class IteratorEnumeration<E> implements Enumeration<E> {
|
|||
this.iterator = iterator;
|
||||
}
|
||||
|
||||
// Iterator interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns true if the underlying iterator has more elements.
|
||||
*
|
||||
|
@ -73,9 +70,6 @@ public class IteratorEnumeration<E> implements Enumeration<E> {
|
|||
return iterator.next();
|
||||
}
|
||||
|
||||
// Properties
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns the underlying iterator.
|
||||
*
|
||||
|
|
|
@ -66,8 +66,6 @@ public class ListIteratorWrapper<E> implements ResettableListIterator<E> {
|
|||
/** recall whether the wrapped iterator's "cursor" is in such a state as to allow remove() to be called */
|
||||
private boolean removeState;
|
||||
|
||||
// Constructor
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs a new {@code ListIteratorWrapper} that will wrap
|
||||
* the given iterator.
|
||||
|
@ -79,8 +77,6 @@ public class ListIteratorWrapper<E> implements ResettableListIterator<E> {
|
|||
this.iterator = Objects.requireNonNull(iterator, "iterator");
|
||||
}
|
||||
|
||||
// ListIterator interface
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Throws {@link UnsupportedOperationException}
|
||||
* unless the underlying {@code Iterator} is a {@code ListIterator}.
|
||||
|
@ -246,8 +242,6 @@ public class ListIteratorWrapper<E> implements ResettableListIterator<E> {
|
|||
throw new UnsupportedOperationException(UNSUPPORTED_OPERATION_MESSAGE);
|
||||
}
|
||||
|
||||
// ResettableIterator interface
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Resets this iterator back to the position at which the iterator
|
||||
* was created.
|
||||
|
|
|
@ -43,7 +43,6 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
|||
/** The current iterator index */
|
||||
int index;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs an ObjectArrayIterator that will iterate over the values in the
|
||||
* specified array.
|
||||
|
@ -98,9 +97,6 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
|||
this.index = start;
|
||||
}
|
||||
|
||||
// Iterator interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns true if there are more elements to return from the array.
|
||||
*
|
||||
|
@ -136,9 +132,6 @@ public class ObjectArrayIterator<E> implements ResettableIterator<E> {
|
|||
throw new UnsupportedOperationException("remove() method is not supported for an ObjectArrayIterator");
|
||||
}
|
||||
|
||||
// Properties
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Gets the array that this iterator is iterating over.
|
||||
*
|
||||
|
|
|
@ -47,7 +47,6 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
|||
*/
|
||||
private int lastItemIndex = -1;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs an ObjectArrayListIterator that will iterate over the values in the
|
||||
* specified array.
|
||||
|
@ -87,9 +86,6 @@ public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
|||
super(array, start, end);
|
||||
}
|
||||
|
||||
// ListIterator interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns true if there are previous elements to return from the array.
|
||||
*
|
||||
|
|
|
@ -30,8 +30,6 @@ import org.apache.commons.collections4.functors.UniquePredicate;
|
|||
*/
|
||||
public class UniqueFilterIterator<E> extends FilterIterator<E> {
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs a new {@code UniqueFilterIterator}.
|
||||
*
|
||||
|
|
|
@ -47,9 +47,6 @@ public class ZippingIterator<E> implements Iterator<E> {
|
|||
/** The last iterator which was used for next(). */
|
||||
private Iterator<? extends E> lastReturned;
|
||||
|
||||
// Constructors
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs a new {@code ZippingIterator} that will provide
|
||||
* interleaved iteration over the two given iterators.
|
||||
|
@ -96,9 +93,6 @@ public class ZippingIterator<E> implements Iterator<E> {
|
|||
this.iterators = FluentIterable.of(list).loop().iterator();
|
||||
}
|
||||
|
||||
// Iterator Methods
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns {@code true} if any child iterator has remaining elements.
|
||||
*
|
||||
|
|
|
@ -38,8 +38,6 @@ public abstract class AbstractMapEntry<K, V> extends AbstractKeyValue<K, V> impl
|
|||
super(key, value);
|
||||
}
|
||||
|
||||
// Map.Entry interface
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the value stored in this {@code Map.Entry}.
|
||||
* <p>
|
||||
|
|
|
@ -54,8 +54,6 @@ public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Seri
|
|||
this.key = key;
|
||||
}
|
||||
|
||||
// Map.Entry interface
|
||||
//-------------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the key of this entry
|
||||
*
|
||||
|
|
|
@ -85,7 +85,6 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
|||
return sl;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructor that wraps (not copies) the List and specifies the set to use.
|
||||
* <p>
|
||||
|
@ -100,7 +99,6 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
|||
this.set = Objects.requireNonNull(set, "set");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets an unmodifiable view as a Set.
|
||||
*
|
||||
|
@ -110,7 +108,6 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
|||
return UnmodifiableSet.unmodifiableSet(set);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Adds an element to the list if it is not already present.
|
||||
* <p>
|
||||
|
@ -197,7 +194,6 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
|||
return super.addAll(index, temp);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Sets the value at the specified index avoiding duplicates.
|
||||
* <p>
|
||||
|
@ -356,7 +352,6 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
|
|||
return subSet;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Inner class iterator.
|
||||
*/
|
||||
|
|
|
@ -56,7 +56,6 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
|
|||
super(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Map<K, List<V>> getMap() {
|
||||
|
@ -70,7 +69,6 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
|
|||
@Override
|
||||
protected abstract List<V> createCollection();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the list of values associated with the specified key. This would
|
||||
* return an empty list in case the mapping is not present
|
||||
|
@ -102,7 +100,6 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
|
|||
return ListUtils.emptyIfNull(getMap().remove(key));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapped list to handle add and remove on the list returned by get(object)
|
||||
*/
|
||||
|
|
|
@ -91,7 +91,6 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
|
|||
this.map = (Map<K, Collection<V>>) Objects.requireNonNull(map, "map");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the map being wrapped.
|
||||
*
|
||||
|
@ -115,7 +114,6 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
|
|||
|
||||
protected abstract Collection<V> createCollection();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public boolean containsKey(final Object key) {
|
||||
return getMap().containsKey(key);
|
||||
|
@ -381,8 +379,6 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
|
|||
return getMap().toString();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Wrapped collection to handle add and remove on the collection returned
|
||||
* by get(object).
|
||||
|
|
|
@ -59,7 +59,6 @@ public abstract class AbstractMultiValuedMapDecorator<K, V>
|
|||
this.map = Objects.requireNonNull(map, "map");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* The decorated multi-valued map.
|
||||
*
|
||||
|
@ -69,7 +68,6 @@ public abstract class AbstractMultiValuedMapDecorator<K, V>
|
|||
return map;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public int size() {
|
||||
return decorated().size();
|
||||
|
|
|
@ -54,7 +54,6 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
|
|||
super(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Map<K, Set<V>> getMap() {
|
||||
|
@ -68,7 +67,6 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
|
|||
@Override
|
||||
protected abstract Set<V> createCollection();
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets the set of values associated with the specified key. This would
|
||||
* return an empty set in case the mapping is not present
|
||||
|
@ -101,7 +99,6 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
|
|||
return SetUtils.emptyIfNull(getMap().remove(key));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Wrapped set to handle add and remove on the collection returned by
|
||||
* {@code get(Object)}.
|
||||
|
|
|
@ -113,13 +113,11 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
|
|||
super.putAll(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
protected ArrayList<V> createCollection() {
|
||||
return new ArrayList<>(initialListCapacity);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Trims the capacity of all value collections to their current size.
|
||||
*/
|
||||
|
@ -130,7 +128,6 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
|
|||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
private void writeObject(final ObjectOutputStream oos) throws IOException {
|
||||
oos.defaultWriteObject();
|
||||
doWriteObject(oos);
|
||||
|
|
|
@ -112,13 +112,11 @@ public class HashSetValuedHashMap<K, V> extends AbstractSetValuedMap<K, V>
|
|||
super.putAll(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
protected HashSet<V> createCollection() {
|
||||
return new HashSet<>(initialSetCapacity);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
private void writeObject(final ObjectOutputStream oos) throws IOException {
|
||||
oos.defaultWriteObject();
|
||||
doWriteObject(oos);
|
||||
|
|
|
@ -102,7 +102,6 @@ public class TransformedMultiValuedMap<K, V> extends AbstractMultiValuedMapDecor
|
|||
return decorated;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
* <p>
|
||||
|
|
|
@ -50,7 +50,6 @@ public class SynchronizedQueue<E> extends SynchronizedCollection<E> implements Q
|
|||
return new SynchronizedQueue<>(queue);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
@ -104,8 +103,6 @@ public class SynchronizedQueue<E> extends SynchronizedCollection<E> implements Q
|
|||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
synchronized (lock) {
|
||||
|
|
|
@ -125,7 +125,6 @@ public class ListOrderedSet<E>
|
|||
return new ListOrderedSet<>(set, list);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructs a new empty {@code ListOrderedSet} using a
|
||||
* {@code HashSet} and an {@code ArrayList} internally.
|
||||
|
@ -163,7 +162,6 @@ public class ListOrderedSet<E>
|
|||
setOrder = Objects.requireNonNull(list, "list");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets an unmodifiable view of the order of the Set.
|
||||
*
|
||||
|
@ -173,7 +171,6 @@ public class ListOrderedSet<E>
|
|||
return UnmodifiableList.unmodifiableList(setOrder);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public void clear() {
|
||||
decorated().clear();
|
||||
|
@ -269,10 +266,6 @@ public class ListOrderedSet<E>
|
|||
return setOrder.toArray(a);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Additional methods that comply to the {@link List} interface
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns the element at the specified position in this ordered set.
|
||||
*
|
||||
|
@ -371,7 +364,6 @@ public class ListOrderedSet<E>
|
|||
return setOrder.toString();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Internal iterator handle remove.
|
||||
*/
|
||||
|
|
|
@ -42,8 +42,6 @@ public class BagUtilsTest {
|
|||
protected Predicate<Object> truePredicate = TruePredicate.truePredicate();
|
||||
protected Transformer<Object, Object> nopTransformer = TransformerUtils.nopTransformer();
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testSynchronizedBag() {
|
||||
final Bag<Object> bag = BagUtils.synchronizedBag(new HashBag<>());
|
||||
|
|
|
@ -67,9 +67,6 @@ public class ClosureUtilsTest {
|
|||
}
|
||||
}
|
||||
|
||||
// exceptionClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExceptionClosure() {
|
||||
assertNotNull(ClosureUtils.exceptionClosure());
|
||||
|
@ -80,9 +77,6 @@ public class ClosureUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// nopClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNopClosure() {
|
||||
final StringBuilder buf = new StringBuilder("Hello");
|
||||
|
@ -92,9 +86,6 @@ public class ClosureUtilsTest {
|
|||
assertEquals("Hello", buf.toString());
|
||||
}
|
||||
|
||||
// invokeClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInvokeClosure() {
|
||||
StringBuffer buf = new StringBuffer("Hello"); // Only StringBuffer has setLength() method
|
||||
|
@ -105,9 +96,6 @@ public class ClosureUtilsTest {
|
|||
assertEquals("He", buf.toString());
|
||||
}
|
||||
|
||||
// forClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testForClosure() {
|
||||
final MockClosure<Object> cmd = new MockClosure<>();
|
||||
|
@ -120,9 +108,6 @@ public class ClosureUtilsTest {
|
|||
assertSame(cmd, ClosureUtils.forClosure(1, cmd));
|
||||
}
|
||||
|
||||
// whileClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testWhileClosure() {
|
||||
MockClosure<Object> cmd = new MockClosure<>();
|
||||
|
@ -139,9 +124,6 @@ public class ClosureUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// doWhileClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testDoWhileClosure() {
|
||||
MockClosure<Object> cmd = new MockClosure<>();
|
||||
|
@ -155,9 +137,6 @@ public class ClosureUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> ClosureUtils.doWhileClosure(null, null));
|
||||
}
|
||||
|
||||
// chainedClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testChainedClosure() {
|
||||
|
@ -199,9 +178,6 @@ public class ClosureUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// ifClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testIfClosure() {
|
||||
MockClosure<Object> a = new MockClosure<>();
|
||||
|
@ -226,9 +202,6 @@ public class ClosureUtilsTest {
|
|||
assertEquals(1, b.count);
|
||||
}
|
||||
|
||||
// switchClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testSwitchClosure() {
|
||||
|
@ -304,9 +277,6 @@ public class ClosureUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// switchMapClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testSwitchMapClosure() {
|
||||
final MockClosure<String> a = new MockClosure<>();
|
||||
|
@ -344,9 +314,6 @@ public class ClosureUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> ClosureUtils.switchMapClosure(null));
|
||||
}
|
||||
|
||||
// asClosure
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testTransformerClosure() {
|
||||
final MockTransformer<Object> mock = new MockTransformer<>();
|
||||
|
@ -359,9 +326,6 @@ public class ClosureUtilsTest {
|
|||
assertEquals(ClosureUtils.nopClosure(), ClosureUtils.asClosure(null));
|
||||
}
|
||||
|
||||
// misc tests
|
||||
//------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Test that all Closure singletons hold singleton pattern in
|
||||
* serialization/deserialization process.
|
||||
|
|
|
@ -63,7 +63,6 @@ import org.junit.jupiter.api.Test;
|
|||
@SuppressWarnings("boxing")
|
||||
public class CollectionUtilsTest extends MockTestCase {
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
private static final Predicate<Number> EQUALS_TWO = input -> input.intValue() == 2;
|
||||
|
||||
/**
|
||||
|
@ -179,7 +178,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
verify();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void addIgnoreNull() {
|
||||
final Set<String> set = new HashSet<>();
|
||||
|
@ -1018,7 +1016,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
expect(iterator.next()).andReturn(t);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void predicatedCollection() {
|
||||
final Predicate<Object> predicate = PredicateUtils.instanceofPredicate(Integer.class);
|
||||
|
@ -1386,7 +1383,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
assertThrows(NullPointerException.class, () -> CollectionUtils.intersection(list, null));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testIsEmptyWithEmptyCollection() {
|
||||
assertTrue(CollectionUtils.isEmpty(new ArrayList<>()));
|
||||
|
@ -1897,8 +1893,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
assertThrows(IndexOutOfBoundsException.class, () -> CollectionUtils.removeRange(list, 0, 2));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
//Up to here
|
||||
@Test
|
||||
public void testRetainAll() {
|
||||
final List<String> base = new ArrayList<>();
|
||||
|
@ -2024,7 +2018,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
assertEquals(2, CollectionUtils.size(list.iterator()));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testSize_List() {
|
||||
List<String> list = null;
|
||||
|
@ -2116,7 +2109,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
assertFalse(CollectionUtils.sizeIsEmpty(map));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testSizeIsEmpty_Null() {
|
||||
assertTrue(CollectionUtils.sizeIsEmpty(null));
|
||||
|
@ -2198,7 +2190,6 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
"Expecting NullPointerException for null collection.");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testTransformedCollection() {
|
||||
final Transformer<Object, Object> transformer = TransformerUtils.nopTransformer();
|
||||
|
|
|
@ -40,9 +40,6 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class FactoryUtilsTest {
|
||||
|
||||
// exceptionFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExceptionFactory() {
|
||||
assertNotNull(FactoryUtils.exceptionFactory());
|
||||
|
@ -51,9 +48,6 @@ public class FactoryUtilsTest {
|
|||
assertThrows(FunctorException.class, () -> FactoryUtils.exceptionFactory().create());
|
||||
}
|
||||
|
||||
// nullFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNullFactory() {
|
||||
final Factory<Object> factory = FactoryUtils.nullFactory();
|
||||
|
@ -62,9 +56,6 @@ public class FactoryUtilsTest {
|
|||
assertNull(created);
|
||||
}
|
||||
|
||||
// constantFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testConstantFactoryNull() {
|
||||
final Factory<Object> factory = FactoryUtils.constantFactory(null);
|
||||
|
@ -82,9 +73,6 @@ public class FactoryUtilsTest {
|
|||
assertSame(constant, created);
|
||||
}
|
||||
|
||||
// prototypeFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testPrototypeFactoryNull() {
|
||||
assertSame(ConstantFactory.NULL_INSTANCE, FactoryUtils.prototypeFactory(null));
|
||||
|
@ -190,9 +178,6 @@ public class FactoryUtilsTest {
|
|||
}
|
||||
}
|
||||
|
||||
// instantiateFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void instantiateFactoryNull() {
|
||||
assertThrows(NullPointerException.class, () -> FactoryUtils.instantiateFactory(null));
|
||||
|
@ -231,9 +216,6 @@ public class FactoryUtilsTest {
|
|||
assertEquals(new Date(1000 * 60 * 60 * 24), created);
|
||||
}
|
||||
|
||||
// misc tests
|
||||
//------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Test that all Factory singletons hold singleton pattern in
|
||||
* serialization/deserialization process.
|
||||
|
|
|
@ -105,7 +105,6 @@ public class FluentIterableTest {
|
|||
|
||||
private static final Predicate<Number> EVEN = input -> input.intValue() % 2 == 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void factoryMethodOf() {
|
||||
FluentIterable<Integer> iterable = FluentIterable.of(1, 2, 3, 4, 5);
|
||||
|
|
|
@ -97,7 +97,6 @@ public class IterableUtilsTest {
|
|||
|
||||
private static final Predicate<Number> EVEN = input -> input.intValue() % 2 == 0;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void forEach() {
|
||||
final List<Integer> listA = new ArrayList<>();
|
||||
|
|
|
@ -511,7 +511,6 @@ public class IteratorUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> IteratorUtils.collatedIterator(null, arrayList.iterator(), arrayList.listIterator(), null));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test empty iterator
|
||||
*/
|
||||
|
@ -534,7 +533,6 @@ public class IteratorUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test empty list iterator
|
||||
*/
|
||||
|
@ -562,7 +560,6 @@ public class IteratorUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test empty map iterator
|
||||
*/
|
||||
|
@ -589,7 +586,6 @@ public class IteratorUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test empty map iterator
|
||||
*/
|
||||
|
@ -614,7 +610,6 @@ public class IteratorUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test empty map iterator
|
||||
*/
|
||||
|
@ -686,7 +681,6 @@ public class IteratorUtilsTest {
|
|||
assertEquals(1, (int) IteratorUtils.first(iterator));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testForEach() {
|
||||
final List<Integer> listA = new ArrayList<>();
|
||||
|
@ -994,7 +988,6 @@ public class IteratorUtilsTest {
|
|||
"remove() should throw an UnsupportedOperationException");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
/**
|
||||
* Test next() and hasNext() for an immutable Iterator.
|
||||
*/
|
||||
|
|
|
@ -128,8 +128,6 @@ public class MapPerformance {
|
|||
System.out.println(name + (endMillis - startMillis));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
private static class DummyMap<K, V> implements Map<K, V> {
|
||||
@Override
|
||||
public void clear() {
|
||||
|
|
|
@ -50,9 +50,6 @@ import org.junit.jupiter.api.Test;
|
|||
@SuppressWarnings("boxing")
|
||||
public class PredicateUtilsTest extends AbstractPredicateTest {
|
||||
|
||||
// exceptionPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExceptionPredicate() {
|
||||
assertNotNull(PredicateUtils.exceptionPredicate());
|
||||
|
@ -63,9 +60,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(FunctorException.class, () -> PredicateUtils.exceptionPredicate().evaluate(cString));
|
||||
}
|
||||
|
||||
// notNullPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testIsNotNullPredicate() {
|
||||
assertNotNull(PredicateUtils.notNullPredicate());
|
||||
|
@ -76,9 +70,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertTrue(PredicateUtils.notNullPredicate().evaluate(cInteger));
|
||||
}
|
||||
|
||||
// identityPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testIdentityPredicate() {
|
||||
assertSame(nullPredicate(), PredicateUtils.identityPredicate(null));
|
||||
|
@ -90,9 +81,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertTrue(PredicateUtils.identityPredicate(cInteger).evaluate(cInteger));
|
||||
}
|
||||
|
||||
// truePredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testTruePredicate() {
|
||||
assertNotNull(TruePredicate.truePredicate());
|
||||
|
@ -103,9 +91,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertTrue(truePredicate().evaluate(cInteger));
|
||||
}
|
||||
|
||||
// falsePredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testFalsePredicate() {
|
||||
assertNotNull(FalsePredicate.falsePredicate());
|
||||
|
@ -116,9 +101,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertFalse(FalsePredicate.falsePredicate().evaluate(cInteger));
|
||||
}
|
||||
|
||||
// notPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNotPredicate() {
|
||||
assertNotNull(PredicateUtils.notPredicate(TruePredicate.truePredicate()));
|
||||
|
@ -133,9 +115,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.notPredicate(null));
|
||||
}
|
||||
|
||||
// andPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testAndPredicate() {
|
||||
assertTrue(PredicateUtils.andPredicate(truePredicate(), truePredicate()).evaluate(null));
|
||||
|
@ -149,9 +128,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.andPredicate(null, null));
|
||||
}
|
||||
|
||||
// allPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAllPredicate() {
|
||||
|
@ -224,9 +200,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> AllPredicate.allPredicate(coll));
|
||||
}
|
||||
|
||||
// orPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testOrPredicate() {
|
||||
assertTrue(PredicateUtils.orPredicate(truePredicate(), truePredicate()).evaluate(null));
|
||||
|
@ -240,9 +213,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.orPredicate(null, null));
|
||||
}
|
||||
|
||||
// anyPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testAnyPredicate() {
|
||||
|
@ -316,9 +286,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.anyPredicate(coll));
|
||||
}
|
||||
|
||||
// eitherPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testEitherPredicate() {
|
||||
assertFalse(PredicateUtils.eitherPredicate(truePredicate(), truePredicate()).evaluate(null));
|
||||
|
@ -332,9 +299,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.eitherPredicate(null, null));
|
||||
}
|
||||
|
||||
// onePredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testOnePredicate() {
|
||||
|
@ -407,9 +371,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.onePredicate(Arrays.asList(null, null)));
|
||||
}
|
||||
|
||||
// neitherPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNeitherPredicate() {
|
||||
assertFalse(PredicateUtils.neitherPredicate(truePredicate(), truePredicate()).evaluate(null));
|
||||
|
@ -423,9 +384,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.neitherPredicate(null, null));
|
||||
}
|
||||
|
||||
// nonePredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testNonePredicate() {
|
||||
|
@ -499,9 +457,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.nonePredicate(coll));
|
||||
}
|
||||
|
||||
// instanceofPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInstanceOfPredicate() {
|
||||
assertNotNull(PredicateUtils.instanceofPredicate(String.class));
|
||||
|
@ -511,9 +466,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertFalse(PredicateUtils.instanceofPredicate(String.class).evaluate(cInteger));
|
||||
}
|
||||
|
||||
// uniquePredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testUniquePredicate() {
|
||||
final Predicate<Object> p = PredicateUtils.uniquePredicate();
|
||||
|
@ -525,9 +477,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertFalse(p.evaluate(cString));
|
||||
}
|
||||
|
||||
// asPredicate(Transformer)
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testAsPredicateTransformer() {
|
||||
assertFalse(PredicateUtils.asPredicate(TransformerUtils.nopTransformer()).evaluate(false));
|
||||
|
@ -544,9 +493,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(FunctorException.class, () -> PredicateUtils.asPredicate(TransformerUtils.nopTransformer()).evaluate(null));
|
||||
}
|
||||
|
||||
// invokerPredicate
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInvokerPredicate() {
|
||||
final List<Object> list = new ArrayList<>();
|
||||
|
@ -570,9 +516,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(FunctorException.class, () -> PredicateUtils.invokerPredicate("noSuchMethod").evaluate(new Object()));
|
||||
}
|
||||
|
||||
// invokerPredicate2
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInvokerPredicate2() {
|
||||
final List<String> list = new ArrayList<>();
|
||||
|
@ -600,9 +543,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
"noSuchMethod", new Class[] {Object.class}, new Object[] {cString}).evaluate(new Object()));
|
||||
}
|
||||
|
||||
// nullIsException
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNullIsExceptionPredicate() {
|
||||
assertTrue(PredicateUtils.nullIsExceptionPredicate(truePredicate()).evaluate(new Object()));
|
||||
|
@ -614,9 +554,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsExceptionPredicate(null));
|
||||
}
|
||||
|
||||
// nullIsTrue
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNullIsTruePredicate() {
|
||||
assertTrue(PredicateUtils.nullIsTruePredicate(truePredicate()).evaluate(null));
|
||||
|
@ -629,9 +566,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsTruePredicate(null));
|
||||
}
|
||||
|
||||
// nullIsFalse
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNullIsFalsePredicate() {
|
||||
assertFalse(PredicateUtils.nullIsFalsePredicate(truePredicate()).evaluate(null));
|
||||
|
@ -644,9 +578,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsFalsePredicate(null));
|
||||
}
|
||||
|
||||
// transformed
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testTransformedPredicate() {
|
||||
assertTrue(PredicateUtils.transformedPredicate(
|
||||
|
@ -663,9 +594,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest {
|
|||
assertThrows(NullPointerException.class, () -> PredicateUtils.transformedPredicate(null, null));
|
||||
}
|
||||
|
||||
// misc tests
|
||||
//------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Test that all Predicate singletons hold singleton pattern in
|
||||
* serialization/deserialization process.
|
||||
|
|
|
@ -38,8 +38,6 @@ public class QueueUtilsTest {
|
|||
protected Predicate<Object> truePredicate = TruePredicate.truePredicate();
|
||||
protected Transformer<Object, Object> nopTransformer = TransformerUtils.nopTransformer();
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testSynchronizedQueue() {
|
||||
final Queue<Object> queue = QueueUtils.synchronizedQueue(new LinkedList<>());
|
||||
|
|
|
@ -54,8 +54,6 @@ public class SplitMapUtilsTest {
|
|||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testReadableMap() {
|
||||
final IterableMap<String, Integer> map = SplitMapUtils.readableMap(transformedMap);
|
||||
|
|
|
@ -51,9 +51,6 @@ public class TransformerUtilsTest {
|
|||
private static final Object cString = "Hello";
|
||||
private static final Object cInteger = Integer.valueOf(6);
|
||||
|
||||
// exceptionTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExceptionTransformer() {
|
||||
assertAll(
|
||||
|
@ -64,9 +61,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// nullTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNullTransformer() {
|
||||
assertNotNull(TransformerUtils.nullTransformer());
|
||||
|
@ -77,9 +71,6 @@ public class TransformerUtilsTest {
|
|||
assertNull(TransformerUtils.nullTransformer().transform(cInteger));
|
||||
}
|
||||
|
||||
// nopTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNopTransformer() {
|
||||
assertNotNull(TransformerUtils.nullTransformer());
|
||||
|
@ -90,9 +81,6 @@ public class TransformerUtilsTest {
|
|||
assertEquals(cInteger, TransformerUtils.nopTransformer().transform(cInteger));
|
||||
}
|
||||
|
||||
// constantTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testConstantTransformer() {
|
||||
assertEquals(cObject, TransformerUtils.constantTransformer(cObject).transform(null));
|
||||
|
@ -102,9 +90,6 @@ public class TransformerUtilsTest {
|
|||
assertSame(ConstantTransformer.NULL_INSTANCE, TransformerUtils.constantTransformer(null));
|
||||
}
|
||||
|
||||
// cloneTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testCloneTransformer() {
|
||||
assertNull(TransformerUtils.cloneTransformer().transform(null));
|
||||
|
@ -114,9 +99,6 @@ public class TransformerUtilsTest {
|
|||
assertThrows(IllegalArgumentException.class, () -> assertEquals(cObject, TransformerUtils.cloneTransformer().transform(cObject)));
|
||||
}
|
||||
|
||||
// mapTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("boxing") // OK in test code
|
||||
public void testMapTransformer() {
|
||||
|
@ -131,9 +113,6 @@ public class TransformerUtilsTest {
|
|||
assertSame(ConstantTransformer.NULL_INSTANCE, TransformerUtils.mapTransformer(null));
|
||||
}
|
||||
|
||||
// commandTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testExecutorTransformer() {
|
||||
assertNull(TransformerUtils.asTransformer(ClosureUtils.nopClosure()).transform(null));
|
||||
|
@ -144,9 +123,6 @@ public class TransformerUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> TransformerUtils.asTransformer((Closure<Object>) null));
|
||||
}
|
||||
|
||||
// predicateTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testPredicateTransformer() {
|
||||
assertEquals(Boolean.TRUE, TransformerUtils.asTransformer(TruePredicate.truePredicate()).transform(null));
|
||||
|
@ -157,9 +133,6 @@ public class TransformerUtilsTest {
|
|||
assertThrows(IllegalArgumentException.class, () -> TransformerUtils.asTransformer((Predicate<Object>) null));
|
||||
}
|
||||
|
||||
// factoryTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testFactoryTransformer() {
|
||||
assertNull(TransformerUtils.asTransformer(FactoryUtils.nullFactory()).transform(null));
|
||||
|
@ -170,9 +143,6 @@ public class TransformerUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> TransformerUtils.asTransformer((Factory<Object>) null));
|
||||
}
|
||||
|
||||
// chainedTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testChainedTransformer() {
|
||||
|
@ -203,9 +173,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// ifTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testIfTransformer() {
|
||||
final Transformer<Object, String> a = TransformerUtils.constantTransformer("A");
|
||||
|
@ -232,9 +199,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// switchTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testSwitchTransformer() {
|
||||
|
@ -284,9 +248,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// switchMapTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testSwitchMapTransformer() {
|
||||
final Transformer<String, String> a = TransformerUtils.constantTransformer("A");
|
||||
|
@ -310,9 +271,6 @@ public class TransformerUtilsTest {
|
|||
assertThrows(NullPointerException.class, () -> TransformerUtils.switchMapTransformer(null));
|
||||
}
|
||||
|
||||
// invokerTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInvokerTransformer() {
|
||||
final List<Object> list = new ArrayList<>();
|
||||
|
@ -326,9 +284,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// invokerTransformer2
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInvokerTransformer2() {
|
||||
final List<Object> list = new ArrayList<>();
|
||||
|
@ -349,9 +304,6 @@ public class TransformerUtilsTest {
|
|||
);
|
||||
}
|
||||
|
||||
// stringValueTransformer
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testStringValueTransformer() {
|
||||
assertNotNull( "StringValueTransformer should NEVER return a null value.",
|
||||
|
@ -362,9 +314,6 @@ public class TransformerUtilsTest {
|
|||
TransformerUtils.stringValueTransformer().transform(6), "StringValueTransformer should return toString value");
|
||||
}
|
||||
|
||||
// instantiateFactory
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testInstantiateTransformerNull() {
|
||||
assertAll(
|
||||
|
@ -384,9 +333,6 @@ public class TransformerUtilsTest {
|
|||
assertEquals(new Date(1000L), trans.transform(Date.class));
|
||||
}
|
||||
|
||||
// misc tests
|
||||
//------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Test that all Transformer singletons hold singleton pattern in
|
||||
* serialization/deserialization process.
|
||||
|
|
|
@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test;
|
|||
*/
|
||||
public class TrieUtilsTest {
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testUnmodifiableTrie() {
|
||||
final Trie<String, Object> trie = TrieUtils.unmodifiableTrie(new PatriciaTrie<>());
|
||||
|
|
|
@ -42,8 +42,6 @@ public class PredicatedBagTest<T> extends AbstractBagTest<T> {
|
|||
return BulkTest.makeSuite(PredicatedBagTest.class);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
protected Predicate<T> stringPredicate() {
|
||||
return o -> o instanceof String;
|
||||
}
|
||||
|
@ -63,8 +61,6 @@ public class PredicatedBagTest<T> extends AbstractBagTest<T> {
|
|||
return decorateBag(new HashBag<T>(), stringPredicate());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testlegalAddRemove() {
|
||||
|
|
|
@ -44,8 +44,6 @@ public class PredicatedSortedBagTest<T> extends AbstractSortedBagTest<T> {
|
|||
return BulkTest.makeSuite(PredicatedSortedBagTest.class);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
protected Predicate<T> stringPredicate() {
|
||||
return o -> o instanceof String;
|
||||
}
|
||||
|
@ -65,8 +63,6 @@ public class PredicatedSortedBagTest<T> extends AbstractSortedBagTest<T> {
|
|||
return decorateBag(new TreeBag<T>(), stringPredicate());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testDecorate() {
|
||||
final SortedBag<T> bag = decorateBag(new TreeBag<T>(), stringPredicate());
|
||||
|
|
|
@ -58,7 +58,6 @@ public class CompositeCollectionTest<E> extends AbstractCollectionTest<E> {
|
|||
return (E[]) new Object[] { "1", "2", "3", "4" };
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* Run stock collection tests without Mutator, so turn off add, remove
|
||||
*/
|
||||
|
@ -77,8 +76,6 @@ public class CompositeCollectionTest<E> extends AbstractCollectionTest<E> {
|
|||
return new HashSet<>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Full collection should look like a collection with 4 elements
|
||||
*/
|
||||
|
|
|
@ -40,8 +40,6 @@ public class IndexedCollectionTest extends AbstractCollectionTest<String> {
|
|||
super(IndexedCollectionTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
protected Collection<String> decorateCollection(final Collection<String> collection) {
|
||||
return IndexedCollection.nonUniqueIndexedCollection(collection, new IntegerTransformer());
|
||||
}
|
||||
|
@ -103,8 +101,6 @@ public class IndexedCollectionTest extends AbstractCollectionTest<String> {
|
|||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testAddedObjectsCanBeRetrievedByKey() throws Exception {
|
||||
final Collection<String> coll = makeTestCollection();
|
||||
|
|
|
@ -39,7 +39,6 @@ public class PredicatedCollectionTest<E> extends AbstractCollectionTest<E> {
|
|||
super(PredicatedCollectionTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
|
||||
|
||||
protected Collection<E> decorateCollection(
|
||||
|
|
|
@ -33,16 +33,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|||
@SuppressWarnings("boxing")
|
||||
public class BooleanComparatorTest extends AbstractComparatorTest<Boolean> {
|
||||
|
||||
// conventional
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public BooleanComparatorTest() {
|
||||
super(BooleanComparatorTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
// collections testing framework
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Comparator<Boolean> makeObject() {
|
||||
return new BooleanComparator();
|
||||
|
@ -63,9 +57,6 @@ public class BooleanComparatorTest extends AbstractComparatorTest<Boolean> {
|
|||
// writeExternalFormToDisk((java.io.Serializable) makeObject(), "src/test/resources/data/test/BooleanComparator.version4.obj");
|
||||
// }
|
||||
|
||||
// tests
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testConstructors() {
|
||||
allTests(false, new BooleanComparator());
|
||||
|
@ -96,9 +87,6 @@ public class BooleanComparatorTest extends AbstractComparatorTest<Boolean> {
|
|||
assertNotEquals(new BooleanComparator(true), new BooleanComparator(false));
|
||||
}
|
||||
|
||||
// utilities
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
protected void allTests(final boolean trueFirst, final BooleanComparator comp) {
|
||||
orderIndependentTests(comp);
|
||||
if (trueFirst) {
|
||||
|
|
|
@ -64,8 +64,6 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
|
|||
return false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testNormalIteration() {
|
||||
final PushbackIterator<E> iter = makeObject();
|
||||
|
|
|
@ -1193,7 +1193,6 @@ public abstract class AbstractListTest<E> extends AbstractCollectionTest<E> {
|
|||
m.getName() + " raised unexpected " + thrown.getTargetException());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
public BulkTest bulkTestListIterator() {
|
||||
return new TestListIterator();
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ public class PredicatedListTest<E> extends AbstractListTest<E> {
|
|||
super(PredicatedListTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
|
||||
|
||||
protected List<E> decorateList(final List<E> list, final Predicate<E> predicate) {
|
||||
|
@ -56,8 +54,6 @@ public class PredicatedListTest<E> extends AbstractListTest<E> {
|
|||
return (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> testPredicate =
|
||||
o -> o instanceof String;
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ public class UnmodifiableMapTest<K, V> extends AbstractIterableMapTest<K, V> {
|
|||
super(UnmodifiableMapTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public IterableMap<K, V> makeObject() {
|
||||
return (IterableMap<K, V>) UnmodifiableMap.unmodifiableMap(new HashMap<K, V>());
|
||||
|
|
|
@ -36,8 +36,6 @@ public class UnmodifiableOrderedMapTest<K, V> extends AbstractOrderedMapTest<K,
|
|||
super(UnmodifiableOrderedMapTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public OrderedMap<K, V> makeObject() {
|
||||
return UnmodifiableOrderedMap.unmodifiableOrderedMap(ListOrderedMap.listOrderedMap(new HashMap<K, V>()));
|
||||
|
|
|
@ -36,8 +36,6 @@ public class UnmodifiableSortedMapTest<K, V> extends AbstractSortedMapTest<K, V>
|
|||
super(UnmodifiableSortedMapTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public SortedMap<K, V> makeObject() {
|
||||
return UnmodifiableSortedMap.unmodifiableSortedMap(new TreeMap<K, V>());
|
||||
|
|
|
@ -449,7 +449,6 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
|||
assertEquals(6, makeFullMap().size());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testMapEquals() {
|
||||
|
@ -843,11 +842,9 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
|
|||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Manual serialization testing as this class cannot easily
|
||||
// extend the AbstractTestMap
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Manual serialization testing as this class cannot easily extend the AbstractTestMap
|
||||
*/
|
||||
@Test
|
||||
public void testEmptyMapCompatibility() throws Exception {
|
||||
final MultiValuedMap<?, ?> map = makeObject();
|
||||
|
|
|
@ -43,13 +43,11 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
|
|||
return BulkTest.makeSuite(ArrayListValuedHashMapTest.class);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public ListValuedMap<K, V> makeObject() {
|
||||
return new ArrayListValuedHashMap<>();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testListValuedMapAdd() {
|
||||
|
|
|
@ -41,7 +41,6 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
|
|||
return BulkTest.makeSuite(HashSetValuedHashMapTest.class);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public SetValuedMap<K, V> makeObject() {
|
||||
return new HashSetValuedHashMap<>();
|
||||
|
@ -57,7 +56,6 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
|
|||
return true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testSetValuedMapAdd() {
|
||||
|
|
|
@ -40,14 +40,12 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
|
|||
return BulkTest.makeSuite(TransformedMultiValuedMapTest.class);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Override
|
||||
public MultiValuedMap<K, V> makeObject() {
|
||||
return TransformedMultiValuedMap.transformingMap(new ArrayListValuedHashMap<K, V>(),
|
||||
TransformerUtils.<K>nopTransformer(), TransformerUtils.<V>nopTransformer());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testKeyTransformedMap() {
|
||||
|
@ -93,7 +91,6 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
|
|||
assertTrue(map.remove(els[0]).contains(Integer.valueOf((String) els[0])));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testFactory_Decorate() {
|
||||
|
|
|
@ -82,7 +82,6 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
|
|||
return UnmodifiableMultiValuedMap.<K, V>unmodifiableMultiValuedMap(map);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testUnmodifiable() {
|
||||
assertTrue(makeObject() instanceof Unmodifiable);
|
||||
|
|
|
@ -42,8 +42,6 @@ public class PredicatedMultiSetTest<T> extends AbstractMultiSetTest<T> {
|
|||
return BulkTest.makeSuite(PredicatedMultiSetTest.class);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
protected Predicate<T> stringPredicate() {
|
||||
return o -> o instanceof String;
|
||||
}
|
||||
|
@ -63,8 +61,6 @@ public class PredicatedMultiSetTest<T> extends AbstractMultiSetTest<T> {
|
|||
return decorateMultiSet(new HashMultiSet<T>(), stringPredicate());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testLegalAddRemove() {
|
||||
|
|
|
@ -39,8 +39,6 @@ public class PredicatedQueueTest<E> extends AbstractQueueTest<E> {
|
|||
super(PredicatedQueueTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
|
||||
|
||||
protected Queue<E> decorateCollection(final Queue<E> queue, final Predicate<E> predicate) {
|
||||
|
@ -69,8 +67,6 @@ public class PredicatedQueueTest<E> extends AbstractQueueTest<E> {
|
|||
return list;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> testPredicate = o -> o instanceof String;
|
||||
|
||||
public Queue<E> makeTestQueue() {
|
||||
|
|
|
@ -38,8 +38,6 @@ public class SynchronizedQueueTest<T> extends AbstractQueueTest<T> {
|
|||
super(SynchronizedQueueTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public String getCompatibilityVersion() {
|
||||
return "4.2";
|
||||
|
|
|
@ -45,8 +45,6 @@ public class PredicatedNavigableSetTest<E> extends AbstractNavigableSetTest<E> {
|
|||
return BulkTest.makeSuite(PredicatedNavigableSetTest.class);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
|
||||
|
||||
@Override
|
||||
|
@ -60,7 +58,6 @@ public class PredicatedNavigableSetTest<E> extends AbstractNavigableSetTest<E> {
|
|||
return PredicatedNavigableSet.predicatedNavigableSet(set, truePredicate);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
protected Predicate<E> testPredicate =
|
||||
o -> o instanceof String && ((String) o).startsWith("A");
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ public class PredicatedSetTest<E> extends AbstractSetTest<E> {
|
|||
super(PredicatedSetTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
|
||||
|
||||
protected PredicatedSet<E> decorateSet(final Set<E> set, final Predicate<? super E> predicate) {
|
||||
|
@ -56,8 +54,6 @@ public class PredicatedSetTest<E> extends AbstractSetTest<E> {
|
|||
return (E[]) new Object[] {"1", "3", "5", "7", "2", "4", "6"};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
protected Predicate<E> testPredicate =
|
||||
o -> o instanceof String;
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ public class UnmodifiableNavigableSetTest<E> extends AbstractNavigableSetTest<E>
|
|||
return BulkTest.makeSuite(UnmodifiableNavigableSetTest.class);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@Override
|
||||
public NavigableSet<E> makeObject() {
|
||||
return UnmodifiableNavigableSet.unmodifiableNavigableSet(new TreeSet<>());
|
||||
|
@ -68,7 +67,6 @@ public class UnmodifiableNavigableSetTest<E> extends AbstractNavigableSetTest<E>
|
|||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void setupSet() {
|
||||
set = makeFullCollection();
|
||||
|
|
|
@ -42,7 +42,6 @@ public class UnmodifiableSetTest<E> extends AbstractSetTest<E> {
|
|||
return BulkTest.makeSuite(UnmodifiableSetTest.class);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@Override
|
||||
public Set<E> makeObject() {
|
||||
return UnmodifiableSet.unmodifiableSet(new HashSet<E>());
|
||||
|
|
|
@ -47,7 +47,6 @@ public class UnmodifiableSortedSetTest<E> extends AbstractSortedSetTest<E> {
|
|||
return BulkTest.makeSuite(UnmodifiableSortedSetTest.class);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@Override
|
||||
public SortedSet<E> makeObject() {
|
||||
return UnmodifiableSortedSet.unmodifiableSortedSet(new TreeSet<E>());
|
||||
|
@ -69,7 +68,6 @@ public class UnmodifiableSortedSetTest<E> extends AbstractSortedSetTest<E> {
|
|||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void setupSet() {
|
||||
set = makeFullCollection();
|
||||
|
|
|
@ -46,7 +46,6 @@ public class TransformedSplitMapTest extends BulkTest {
|
|||
super(TransformedSplitMapTest.class.getSimpleName());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testTransformedMap() {
|
||||
final TransformedSplitMap<Integer, String, Object, Class<?>> map = TransformedSplitMap.transformingMap(
|
||||
|
@ -90,8 +89,6 @@ public class TransformedSplitMapTest extends BulkTest {
|
|||
assertEquals(--sz2, map2.size());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@Test
|
||||
public void testMapIterator() {
|
||||
final TransformedSplitMap<String, String, String, Integer> map =
|
||||
|
|
|
@ -40,8 +40,6 @@ public class UnmodifiableTrieTest<V> extends AbstractSortedMapTest<String, V> {
|
|||
return BulkTest.makeSuite(UnmodifiableTrieTest.class);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Trie<String, V> makeObject() {
|
||||
return UnmodifiableTrie.unmodifiableTrie(new PatriciaTrie<V>());
|
||||
|
|
Loading…
Reference in New Issue