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