From 1e0646ee8d160e2635be9c8bea1be019873e5efe Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Tue, 31 May 2022 15:56:42 -0400 Subject: [PATCH] Remove noisy inline comments. --- .../commons/collections4/FluentIterable.java | 12 ---- .../commons/collections4/IterableUtils.java | 42 ----------- .../apache/commons/collections4/MapUtils.java | 16 ----- .../commons/collections4/MultiMapUtils.java | 9 --- .../commons/collections4/PredicateUtils.java | 12 ---- .../collections4/bidimap/TreeBidiMap.java | 1 - .../collection/PredicatedCollection.java | 1 - .../collections4/iterators/ArrayIterator.java | 2 - .../iterators/ArrayListIterator.java | 2 - .../iterators/CollatingIterator.java | 8 --- .../iterators/IteratorEnumeration.java | 6 -- .../iterators/ListIteratorWrapper.java | 6 -- .../iterators/ObjectArrayIterator.java | 7 -- .../iterators/ObjectArrayListIterator.java | 4 -- .../iterators/UniqueFilterIterator.java | 2 - .../iterators/ZippingIterator.java | 6 -- .../keyvalue/AbstractMapEntry.java | 2 - .../collections4/keyvalue/TiedMapEntry.java | 2 - .../collections4/list/SetUniqueList.java | 5 -- .../multimap/AbstractListValuedMap.java | 3 - .../multimap/AbstractMultiValuedMap.java | 4 -- .../AbstractMultiValuedMapDecorator.java | 2 - .../multimap/AbstractSetValuedMap.java | 3 - .../multimap/ArrayListValuedHashMap.java | 3 - .../multimap/HashSetValuedHashMap.java | 2 - .../multimap/TransformedMultiValuedMap.java | 1 - .../collections4/queue/SynchronizedQueue.java | 3 - .../collections4/set/ListOrderedSet.java | 8 --- .../commons/collections4/BagUtilsTest.java | 2 - .../collections4/ClosureUtilsTest.java | 36 ---------- .../collections4/CollectionUtilsTest.java | 9 --- .../collections4/FactoryUtilsTest.java | 18 ----- .../collections4/FluentIterableTest.java | 1 - .../collections4/IterableUtilsTest.java | 1 - .../collections4/IteratorUtilsTest.java | 7 -- .../commons/collections4/MapPerformance.java | 2 - .../collections4/PredicateUtilsTest.java | 72 ------------------- .../commons/collections4/QueueUtilsTest.java | 2 - .../collections4/SplitMapUtilsTest.java | 2 - .../collections4/TransformerUtilsTest.java | 54 -------------- .../commons/collections4/TrieUtilsTest.java | 2 - .../collections4/bag/PredicatedBagTest.java | 4 -- .../bag/PredicatedSortedBagTest.java | 4 -- .../collection/CompositeCollectionTest.java | 3 - .../collection/IndexedCollectionTest.java | 4 -- .../collection/PredicatedCollectionTest.java | 1 - .../comparators/BooleanComparatorTest.java | 12 ---- .../iterators/PushbackIteratorTest.java | 2 - .../collections4/list/AbstractListTest.java | 1 - .../collections4/list/PredicatedListTest.java | 4 -- .../collections4/map/UnmodifiableMapTest.java | 2 - .../map/UnmodifiableOrderedMapTest.java | 2 - .../map/UnmodifiableSortedMapTest.java | 2 - .../multimap/AbstractMultiValuedMapTest.java | 9 +-- .../multimap/ArrayListValuedHashMapTest.java | 2 - .../multimap/HashSetValuedHashMapTest.java | 2 - .../TransformedMultiValuedMapTest.java | 3 - .../UnmodifiableMultiValuedMapTest.java | 1 - .../multiset/PredicatedMultiSetTest.java | 4 -- .../queue/PredicatedQueueTest.java | 4 -- .../queue/SynchronizedQueueTest.java | 2 - .../set/PredicatedNavigableSetTest.java | 3 - .../collections4/set/PredicatedSetTest.java | 4 -- .../set/UnmodifiableNavigableSetTest.java | 2 - .../collections4/set/UnmodifiableSetTest.java | 1 - .../set/UnmodifiableSortedSetTest.java | 2 - .../splitmap/TransformedSplitMapTest.java | 3 - .../trie/UnmodifiableTrieTest.java | 2 - 68 files changed, 3 insertions(+), 464 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/FluentIterable.java b/src/main/java/org/apache/commons/collections4/FluentIterable.java index 0d1bebccb..36cbbc464 100644 --- a/src/main/java/org/apache/commons/collections4/FluentIterable.java +++ b/src/main/java/org/apache/commons/collections4/FluentIterable.java @@ -70,9 +70,6 @@ public class FluentIterable implements Iterable { /** A reference to the wrapped iterable. */ private final Iterable iterable; - // Static factory methods - // ---------------------------------------------------------------------- - /** * Creates a new empty FluentIterable. * @@ -130,9 +127,6 @@ public class FluentIterable implements Iterable { return new FluentIterable<>(iterable); } - // Constructor - // ---------------------------------------------------------------------- - /** * Don't allow instances. */ @@ -148,9 +142,6 @@ public class FluentIterable implements Iterable { this.iterable = iterable; } - // fluent construction methods - // ---------------------------------------------------------------------- - /** * Returns a new FluentIterable whose iterator will first traverse * the elements of the current iterable, followed by the provided @@ -357,9 +348,6 @@ public class FluentIterable implements Iterable { return of(IterableUtils.zippingIterable(iterable, others)); } - // convenience methods - // ---------------------------------------------------------------------- - /** {@inheritDoc} */ @Override public Iterator iterator() { diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index 0d6b89be5..aea4e61fb 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -61,9 +61,6 @@ public class IterableUtils { } }; - // Empty - // ---------------------------------------------------------------------- - /** * Gets an empty iterable. *

@@ -77,9 +74,6 @@ public class IterableUtils { return EMPTY_ITERABLE; } - // Chained - // ---------------------------------------------------------------------- - /** * Combines two iterables into a single iterable. *

@@ -185,9 +179,6 @@ public class IterableUtils { }; } - // Collated - // ---------------------------------------------------------------------- - /** * Combines the two provided iterables into an ordered iterable using * natural ordering. @@ -240,9 +231,6 @@ public class IterableUtils { }; } - // Filtered - // ---------------------------------------------------------------------- - /** * Returns a view of the given iterable that only contains elements matching * the provided predicate. @@ -268,9 +256,6 @@ public class IterableUtils { }; } - // Bounded - // ---------------------------------------------------------------------- - /** * Returns a view of the given iterable that contains at most the given number * of elements. @@ -299,9 +284,6 @@ public class IterableUtils { }; } - // Looping - // ---------------------------------------------------------------------- - /** * Returns a view of the given iterable which will cycle infinitely over * its elements. @@ -335,9 +317,6 @@ public class IterableUtils { }; } - // Reversed - // ---------------------------------------------------------------------- - /** * Returns a reversed view of the given iterable. *

@@ -367,9 +346,6 @@ public class IterableUtils { }; } - // Skipping - // ---------------------------------------------------------------------- - /** * Returns a view of the given iterable that skips the first N elements. *

@@ -397,9 +373,6 @@ public class IterableUtils { }; } - // Transformed - // ---------------------------------------------------------------------- - /** * Returns a transformed view of the given iterable where all of its elements * have been transformed by the provided transformer. @@ -426,9 +399,6 @@ public class IterableUtils { }; } - // Unique - // ---------------------------------------------------------------------- - /** * Returns a unique view of the given iterable. *

@@ -451,9 +421,6 @@ public class IterableUtils { }; } - // Unmodifiable - // ---------------------------------------------------------------------- - /** * Returns an unmodifiable view of the given iterable. *

@@ -488,9 +455,6 @@ public class IterableUtils { } } - // Zipping - // ---------------------------------------------------------------------- - /** * Interleaves two iterables into a single iterable. *

@@ -554,9 +518,6 @@ public class IterableUtils { }; } - // Utility methods - // ---------------------------------------------------------------------- - /** * Returns an immutable empty iterable if the argument is null, * or the argument itself otherwise. @@ -1044,9 +1005,6 @@ public class IterableUtils { transformer, delimiter, prefix, suffix); } - // Helper methods - // ---------------------------------------------------------------------- - /** * Fail-fast check for null arguments. * diff --git a/src/main/java/org/apache/commons/collections4/MapUtils.java b/src/main/java/org/apache/commons/collections4/MapUtils.java index 15ea58b9c..5318c2eac 100644 --- a/src/main/java/org/apache/commons/collections4/MapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MapUtils.java @@ -274,8 +274,6 @@ public class MapUtils { return applyDefaultFunction(map, key, MapUtils::getBoolean, defaultFunction); } - // Type safe primitive getters - // ------------------------------------------------------------------------- /** * Gets a boolean from a Map in a null-safe manner. *

@@ -294,8 +292,6 @@ public class MapUtils { return Boolean.TRUE.equals(getBoolean(map, key)); } - // Type safe primitive getters with default values - // ------------------------------------------------------------------------- /** * Gets a boolean from a Map in a null-safe manner, using the default value if the conversion fails. *

@@ -979,7 +975,6 @@ public class MapUtils { return applyDefaultValue(map, key, MapUtils::getNumber, defaultValue); } - // ------------------------------------------------------------------------- /** * Gets from a Map in a null-safe manner. * @@ -996,7 +991,6 @@ public class MapUtils { return null; } - // ------------------------------------------------------------------------- /** * Looks up the given key in the given map, converting null into the given default value. * @@ -1175,8 +1169,6 @@ public class MapUtils { return applyDefaultValue(map, key, MapUtils::getString, defaultValue); } - // Misc - // ----------------------------------------------------------------------- /** * Inverts the supplied map returning a new HashMap such that the keys of the input are swapped with the values. *

@@ -1298,8 +1290,6 @@ public class MapUtils { return LazyMap.lazyMap(map, factory); } - // ----------------------------------------------------------------------- - /** * Returns a "lazy" map whose values will be created on demand. *

@@ -1623,7 +1613,6 @@ public class MapUtils { } } - // ----------------------------------------------------------------------- /** * Puts all the keys and values from the specified array into the map. *

@@ -1745,7 +1734,6 @@ public class MapUtils { return map == null ? 0 : map.size(); } - // ----------------------------------------------------------------------- /** * Returns a synchronized map backed by the given map. *

@@ -1776,7 +1764,6 @@ public class MapUtils { return Collections.synchronizedMap(map); } - // ----------------------------------------------------------------------- /** * Returns a synchronized sorted map backed by the given sorted map. *

@@ -1829,7 +1816,6 @@ public class MapUtils { return map; } - // ------------------------------------------------------------------------- /** * Gets a new Properties object initialized with the values from a Map. A null input will return an empty properties * object. @@ -1947,8 +1933,6 @@ public class MapUtils { return UnmodifiableSortedMap.unmodifiableSortedMap(map); } - // Printing methods - // ------------------------------------------------------------------------- /** * Prints the given map with nice line breaks. *

diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java index 0d701ff8d..fe3771d4a 100644 --- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java @@ -95,9 +95,6 @@ public class MultiMapUtils { return map == null || map.isEmpty(); } - // Null safe getters - // ------------------------------------------------------------------------- - /** * Gets a Collection from {@code MultiValuedMap} in a null-safe manner. * @@ -177,9 +174,6 @@ public class MultiMapUtils { return null; } - // Factory Methods - // ----------------------------------------------------------------------- - /** * Creates a {@link ListValuedMap} with an {@link java.util.ArrayList ArrayList} as * collection class to store the values mapped to a key. @@ -204,9 +198,6 @@ public class MultiMapUtils { return new HashSetValuedHashMap<>(); } - // MultiValuedMap Decorators - // ----------------------------------------------------------------------- - /** * Returns an {@code UnmodifiableMultiValuedMap} backed by the given * map. diff --git a/src/main/java/org/apache/commons/collections4/PredicateUtils.java b/src/main/java/org/apache/commons/collections4/PredicateUtils.java index 8beb444e6..d2e0bbfc6 100644 --- a/src/main/java/org/apache/commons/collections4/PredicateUtils.java +++ b/src/main/java/org/apache/commons/collections4/PredicateUtils.java @@ -75,9 +75,6 @@ public class PredicateUtils { */ private PredicateUtils() {} - // Simple predicates - //----------------------------------------------------------------------------- - /** * Gets a Predicate that always throws an exception. * This could be useful during testing as a placeholder. @@ -238,9 +235,6 @@ public class PredicateUtils { return asPredicate(InvokerTransformer.invokerTransformer(methodName, paramTypes, args)); } - // Boolean combinations - //----------------------------------------------------------------------------- - /** * Create a new Predicate that returns true only if both of the specified * predicates are true. @@ -451,9 +445,6 @@ public class PredicateUtils { return NotPredicate.notPredicate(predicate); } - // Adaptors - //----------------------------------------------------------------------------- - /** * Create a new Predicate that wraps a Transformer. The Transformer must * return either Boolean.TRUE or Boolean.FALSE otherwise a PredicateException @@ -469,9 +460,6 @@ public class PredicateUtils { return TransformerPredicate.transformerPredicate(transformer); } - // Null handlers - //----------------------------------------------------------------------------- - /** * Gets a Predicate that throws an exception if the input object is null, * otherwise it calls the specified Predicate. This allows null handling diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java index f5f09f22e..7b5aa39fc 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java @@ -2015,7 +2015,6 @@ public class TreeBidiMap, V extends Comparable> && parentNode[dataElement.ordinal()].rightNode[dataElement.ordinal()] == this; } - //------------------------------------------------------------------- /** * Gets the key. * diff --git a/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java b/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java index d72473cc3..a877005e4 100644 --- a/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java +++ b/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java @@ -212,7 +212,6 @@ public class PredicatedCollection extends AbstractCollectionDecorator { /** The buffer containing rejected elements. */ private final List rejected = new ArrayList<>(); - // ----------------------------------------------------------------------- /** * Constructs a PredicatedCollectionBuilder with the specified Predicate. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java index db89e8146..fa06ecdd1 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java @@ -46,8 +46,6 @@ public class ArrayIterator implements ResettableIterator { /** The current iterator index */ int index; - // Constructors - // ---------------------------------------------------------------------- /** * Constructs an ArrayIterator that will iterate over the values in the * specified array. diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java index 34533c132..eedb4fd6e 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java @@ -50,8 +50,6 @@ public class ArrayListIterator extends ArrayIterator */ private int lastItemIndex = -1; - // Constructors - // ---------------------------------------------------------------------- /** * Constructs an ArrayListIterator that will iterate over the values in the * specified array. diff --git a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java index aff22f302..161bfba17 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java @@ -59,8 +59,6 @@ public class CollatingIterator implements Iterator { */ private int lastReturned = -1; - // Constructors - // ---------------------------------------------------------------------- /** * Constructs a new {@code CollatingIterator}. A comparator must be * set by calling {@link #setComparator(Comparator)} before invoking @@ -154,8 +152,6 @@ public class CollatingIterator implements Iterator { } } - // Public Methods - // ---------------------------------------------------------------------- /** * Adds the given {@link Iterator} to the iterators being collated. * @@ -217,8 +213,6 @@ public class CollatingIterator implements Iterator { comparator = comp; } - // Iterator Methods - // ------------------------------------------------------------------- /** * Returns {@code true} if any child iterator has remaining elements. * @@ -279,8 +273,6 @@ public class CollatingIterator implements Iterator { return lastReturned; } - // Private Methods - // ------------------------------------------------------------------- /** * Initializes the collating state if it hasn't been already. */ diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java index 23c9c799f..7422bf22e 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java @@ -48,9 +48,6 @@ public class IteratorEnumeration implements Enumeration { this.iterator = iterator; } - // Iterator interface - //------------------------------------------------------------------------- - /** * Returns true if the underlying iterator has more elements. * @@ -73,9 +70,6 @@ public class IteratorEnumeration implements Enumeration { return iterator.next(); } - // Properties - //------------------------------------------------------------------------- - /** * Returns the underlying iterator. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java index 43781d42a..48ab29f16 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java @@ -66,8 +66,6 @@ public class ListIteratorWrapper implements ResettableListIterator { /** recall whether the wrapped iterator's "cursor" is in such a state as to allow remove() to be called */ private boolean removeState; - // Constructor - //------------------------------------------------------------------------- /** * Constructs a new {@code ListIteratorWrapper} that will wrap * the given iterator. @@ -79,8 +77,6 @@ public class ListIteratorWrapper implements ResettableListIterator { this.iterator = Objects.requireNonNull(iterator, "iterator"); } - // ListIterator interface - //------------------------------------------------------------------------- /** * Throws {@link UnsupportedOperationException} * unless the underlying {@code Iterator} is a {@code ListIterator}. @@ -246,8 +242,6 @@ public class ListIteratorWrapper implements ResettableListIterator { throw new UnsupportedOperationException(UNSUPPORTED_OPERATION_MESSAGE); } - // ResettableIterator interface - //------------------------------------------------------------------------- /** * Resets this iterator back to the position at which the iterator * was created. diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java index f76405bca..6fa55a42d 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java @@ -43,7 +43,6 @@ public class ObjectArrayIterator implements ResettableIterator { /** The current iterator index */ int index; - //------------------------------------------------------------------------- /** * Constructs an ObjectArrayIterator that will iterate over the values in the * specified array. @@ -98,9 +97,6 @@ public class ObjectArrayIterator implements ResettableIterator { this.index = start; } - // Iterator interface - //------------------------------------------------------------------------- - /** * Returns true if there are more elements to return from the array. * @@ -136,9 +132,6 @@ public class ObjectArrayIterator implements ResettableIterator { throw new UnsupportedOperationException("remove() method is not supported for an ObjectArrayIterator"); } - // Properties - //------------------------------------------------------------------------- - /** * Gets the array that this iterator is iterating over. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java index fdf820935..772dc20d3 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java @@ -47,7 +47,6 @@ public class ObjectArrayListIterator extends ObjectArrayIterator */ private int lastItemIndex = -1; - //------------------------------------------------------------------------- /** * Constructs an ObjectArrayListIterator that will iterate over the values in the * specified array. @@ -87,9 +86,6 @@ public class ObjectArrayListIterator extends ObjectArrayIterator super(array, start, end); } - // ListIterator interface - //------------------------------------------------------------------------- - /** * Returns true if there are previous elements to return from the array. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java index 059bbec85..1d4b0a61d 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java @@ -30,8 +30,6 @@ import org.apache.commons.collections4.functors.UniquePredicate; */ public class UniqueFilterIterator extends FilterIterator { - //------------------------------------------------------------------------- - /** * Constructs a new {@code UniqueFilterIterator}. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java index 1dec43887..54c4a72a2 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java @@ -47,9 +47,6 @@ public class ZippingIterator implements Iterator { /** The last iterator which was used for next(). */ private Iterator lastReturned; - // Constructors - // ---------------------------------------------------------------------- - /** * Constructs a new {@code ZippingIterator} that will provide * interleaved iteration over the two given iterators. @@ -96,9 +93,6 @@ public class ZippingIterator implements Iterator { this.iterators = FluentIterable.of(list).loop().iterator(); } - // Iterator Methods - // ------------------------------------------------------------------- - /** * Returns {@code true} if any child iterator has remaining elements. * diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java index 7b76e2354..ac1c3d9ac 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java @@ -38,8 +38,6 @@ public abstract class AbstractMapEntry extends AbstractKeyValue impl super(key, value); } - // Map.Entry interface - //------------------------------------------------------------------------- /** * Sets the value stored in this {@code Map.Entry}. *

diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java index 832681745..b4667c06d 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java @@ -54,8 +54,6 @@ public class TiedMapEntry implements Map.Entry, KeyValue, Seri this.key = key; } - // Map.Entry interface - //------------------------------------------------------------------------- /** * Gets the key of this entry * diff --git a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java index 481ec11aa..a52182fa0 100644 --- a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java +++ b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java @@ -85,7 +85,6 @@ public class SetUniqueList extends AbstractSerializableListDecorator { return sl; } - // ----------------------------------------------------------------------- /** * Constructor that wraps (not copies) the List and specifies the set to use. *

@@ -100,7 +99,6 @@ public class SetUniqueList extends AbstractSerializableListDecorator { this.set = Objects.requireNonNull(set, "set"); } - // ----------------------------------------------------------------------- /** * Gets an unmodifiable view as a Set. * @@ -110,7 +108,6 @@ public class SetUniqueList extends AbstractSerializableListDecorator { return UnmodifiableSet.unmodifiableSet(set); } - // ----------------------------------------------------------------------- /** * Adds an element to the list if it is not already present. *

@@ -197,7 +194,6 @@ public class SetUniqueList extends AbstractSerializableListDecorator { return super.addAll(index, temp); } - // ----------------------------------------------------------------------- /** * Sets the value at the specified index avoiding duplicates. *

@@ -356,7 +352,6 @@ public class SetUniqueList extends AbstractSerializableListDecorator { return subSet; } - // ----------------------------------------------------------------------- /** * Inner class iterator. */ diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java index 5b78c7050..89855e17d 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java @@ -56,7 +56,6 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap super(map); } - // ----------------------------------------------------------------------- @Override @SuppressWarnings("unchecked") protected Map> getMap() { @@ -70,7 +69,6 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap @Override protected abstract List createCollection(); - // ----------------------------------------------------------------------- /** * Gets the list of values associated with the specified key. This would * return an empty list in case the mapping is not present @@ -102,7 +100,6 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap return ListUtils.emptyIfNull(getMap().remove(key)); } - // ----------------------------------------------------------------------- /** * Wrapped list to handle add and remove on the list returned by get(object) */ diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java index e8cab8c1b..84fe5d5c7 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java @@ -91,7 +91,6 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap>) Objects.requireNonNull(map, "map"); } - // ----------------------------------------------------------------------- /** * Gets the map being wrapped. * @@ -115,7 +114,6 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap createCollection(); - // ----------------------------------------------------------------------- @Override public boolean containsKey(final Object key) { return getMap().containsKey(key); @@ -381,8 +379,6 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap this.map = Objects.requireNonNull(map, "map"); } - // ----------------------------------------------------------------------- /** * The decorated multi-valued map. * @@ -69,7 +68,6 @@ public abstract class AbstractMultiValuedMapDecorator return map; } - // ----------------------------------------------------------------------- @Override public int size() { return decorated().size(); diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java index ccf42fcfe..64745cedb 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java @@ -54,7 +54,6 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< super(map); } - // ----------------------------------------------------------------------- @Override @SuppressWarnings("unchecked") protected Map> getMap() { @@ -68,7 +67,6 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< @Override protected abstract Set createCollection(); - // ----------------------------------------------------------------------- /** * Gets the set of values associated with the specified key. This would * return an empty set in case the mapping is not present @@ -101,7 +99,6 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< return SetUtils.emptyIfNull(getMap().remove(key)); } - // ----------------------------------------------------------------------- /** * Wrapped set to handle add and remove on the collection returned by * {@code get(Object)}. diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java index bc0d1ece6..bc6b2700a 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java @@ -113,13 +113,11 @@ public class ArrayListValuedHashMap extends AbstractListValuedMap super.putAll(map); } - // ----------------------------------------------------------------------- @Override protected ArrayList createCollection() { return new ArrayList<>(initialListCapacity); } - // ----------------------------------------------------------------------- /** * Trims the capacity of all value collections to their current size. */ @@ -130,7 +128,6 @@ public class ArrayListValuedHashMap extends AbstractListValuedMap } } - // ----------------------------------------------------------------------- private void writeObject(final ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); doWriteObject(oos); diff --git a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java index d839b8e89..f6b8c1689 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java @@ -112,13 +112,11 @@ public class HashSetValuedHashMap extends AbstractSetValuedMap super.putAll(map); } - // ----------------------------------------------------------------------- @Override protected HashSet createCollection() { return new HashSet<>(initialSetCapacity); } - // ----------------------------------------------------------------------- private void writeObject(final ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); doWriteObject(oos); diff --git a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java index c17c9ccbb..1aed5e8dd 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java @@ -102,7 +102,6 @@ public class TransformedMultiValuedMap extends AbstractMultiValuedMapDecor return decorated; } - // ----------------------------------------------------------------------- /** * Constructor that wraps (not copies). *

diff --git a/src/main/java/org/apache/commons/collections4/queue/SynchronizedQueue.java b/src/main/java/org/apache/commons/collections4/queue/SynchronizedQueue.java index 182d7d76a..0517dbf16 100644 --- a/src/main/java/org/apache/commons/collections4/queue/SynchronizedQueue.java +++ b/src/main/java/org/apache/commons/collections4/queue/SynchronizedQueue.java @@ -50,7 +50,6 @@ public class SynchronizedQueue extends SynchronizedCollection implements Q return new SynchronizedQueue<>(queue); } - // ----------------------------------------------------------------------- /** * Constructor that wraps (not copies). * @@ -104,8 +103,6 @@ public class SynchronizedQueue extends SynchronizedCollection implements Q } } - // ----------------------------------------------------------------------- - @Override public int hashCode() { synchronized (lock) { diff --git a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java index 8d539d5ef..2e5b17a68 100644 --- a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java @@ -125,7 +125,6 @@ public class ListOrderedSet return new ListOrderedSet<>(set, list); } - // ----------------------------------------------------------------------- /** * Constructs a new empty {@code ListOrderedSet} using a * {@code HashSet} and an {@code ArrayList} internally. @@ -163,7 +162,6 @@ public class ListOrderedSet setOrder = Objects.requireNonNull(list, "list"); } - // ----------------------------------------------------------------------- /** * Gets an unmodifiable view of the order of the Set. * @@ -173,7 +171,6 @@ public class ListOrderedSet return UnmodifiableList.unmodifiableList(setOrder); } - // ----------------------------------------------------------------------- @Override public void clear() { decorated().clear(); @@ -269,10 +266,6 @@ public class ListOrderedSet return setOrder.toArray(a); } - // ----------------------------------------------------------------------- - // Additional methods that comply to the {@link List} interface - // ----------------------------------------------------------------------- - /** * Returns the element at the specified position in this ordered set. * @@ -371,7 +364,6 @@ public class ListOrderedSet return setOrder.toString(); } - // ----------------------------------------------------------------------- /** * Internal iterator handle remove. */ diff --git a/src/test/java/org/apache/commons/collections4/BagUtilsTest.java b/src/test/java/org/apache/commons/collections4/BagUtilsTest.java index d50ebbef9..f09a8e82c 100644 --- a/src/test/java/org/apache/commons/collections4/BagUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/BagUtilsTest.java @@ -42,8 +42,6 @@ public class BagUtilsTest { protected Predicate truePredicate = TruePredicate.truePredicate(); protected Transformer nopTransformer = TransformerUtils.nopTransformer(); - //---------------------------------------------------------------------- - @Test public void testSynchronizedBag() { final Bag bag = BagUtils.synchronizedBag(new HashBag<>()); diff --git a/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java b/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java index 1e97f8fe7..d096de3e2 100644 --- a/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java @@ -67,9 +67,6 @@ public class ClosureUtilsTest { } } - // exceptionClosure - //------------------------------------------------------------------ - @Test public void testExceptionClosure() { assertNotNull(ClosureUtils.exceptionClosure()); @@ -80,9 +77,6 @@ public class ClosureUtilsTest { ); } - // nopClosure - //------------------------------------------------------------------ - @Test public void testNopClosure() { final StringBuilder buf = new StringBuilder("Hello"); @@ -92,9 +86,6 @@ public class ClosureUtilsTest { assertEquals("Hello", buf.toString()); } - // invokeClosure - //------------------------------------------------------------------ - @Test public void testInvokeClosure() { StringBuffer buf = new StringBuffer("Hello"); // Only StringBuffer has setLength() method @@ -105,9 +96,6 @@ public class ClosureUtilsTest { assertEquals("He", buf.toString()); } - // forClosure - //------------------------------------------------------------------ - @Test public void testForClosure() { final MockClosure cmd = new MockClosure<>(); @@ -120,9 +108,6 @@ public class ClosureUtilsTest { assertSame(cmd, ClosureUtils.forClosure(1, cmd)); } - // whileClosure - //------------------------------------------------------------------ - @Test public void testWhileClosure() { MockClosure cmd = new MockClosure<>(); @@ -139,9 +124,6 @@ public class ClosureUtilsTest { ); } - // doWhileClosure - //------------------------------------------------------------------ - @Test public void testDoWhileClosure() { MockClosure cmd = new MockClosure<>(); @@ -155,9 +137,6 @@ public class ClosureUtilsTest { assertThrows(NullPointerException.class, () -> ClosureUtils.doWhileClosure(null, null)); } - // chainedClosure - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testChainedClosure() { @@ -199,9 +178,6 @@ public class ClosureUtilsTest { ); } - // ifClosure - //------------------------------------------------------------------ - @Test public void testIfClosure() { MockClosure a = new MockClosure<>(); @@ -226,9 +202,6 @@ public class ClosureUtilsTest { assertEquals(1, b.count); } - // switchClosure - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testSwitchClosure() { @@ -304,9 +277,6 @@ public class ClosureUtilsTest { ); } - // switchMapClosure - //------------------------------------------------------------------ - @Test public void testSwitchMapClosure() { final MockClosure a = new MockClosure<>(); @@ -344,9 +314,6 @@ public class ClosureUtilsTest { assertThrows(NullPointerException.class, () -> ClosureUtils.switchMapClosure(null)); } - // asClosure - //------------------------------------------------------------------ - @Test public void testTransformerClosure() { final MockTransformer mock = new MockTransformer<>(); @@ -359,9 +326,6 @@ public class ClosureUtilsTest { assertEquals(ClosureUtils.nopClosure(), ClosureUtils.asClosure(null)); } - // misc tests - //------------------------------------------------------------------ - /** * Test that all Closure singletons hold singleton pattern in * serialization/deserialization process. diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java index b544a4cc6..af6b32e7c 100644 --- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java @@ -63,7 +63,6 @@ import org.junit.jupiter.api.Test; @SuppressWarnings("boxing") public class CollectionUtilsTest extends MockTestCase { - // ----------------------------------------------------------------------- private static final Predicate EQUALS_TWO = input -> input.intValue() == 2; /** @@ -179,7 +178,6 @@ public class CollectionUtilsTest extends MockTestCase { verify(); } - // ----------------------------------------------------------------------- @Test public void addIgnoreNull() { final Set set = new HashSet<>(); @@ -1018,7 +1016,6 @@ public class CollectionUtilsTest extends MockTestCase { expect(iterator.next()).andReturn(t); } - // ----------------------------------------------------------------------- @Test public void predicatedCollection() { final Predicate predicate = PredicateUtils.instanceofPredicate(Integer.class); @@ -1386,7 +1383,6 @@ public class CollectionUtilsTest extends MockTestCase { assertThrows(NullPointerException.class, () -> CollectionUtils.intersection(list, null)); } - // ----------------------------------------------------------------------- @Test public void testIsEmptyWithEmptyCollection() { assertTrue(CollectionUtils.isEmpty(new ArrayList<>())); @@ -1897,8 +1893,6 @@ public class CollectionUtilsTest extends MockTestCase { assertThrows(IndexOutOfBoundsException.class, () -> CollectionUtils.removeRange(list, 0, 2)); } - // ----------------------------------------------------------------------- - //Up to here @Test public void testRetainAll() { final List base = new ArrayList<>(); @@ -2024,7 +2018,6 @@ public class CollectionUtilsTest extends MockTestCase { assertEquals(2, CollectionUtils.size(list.iterator())); } - // ----------------------------------------------------------------------- @Test public void testSize_List() { List list = null; @@ -2116,7 +2109,6 @@ public class CollectionUtilsTest extends MockTestCase { assertFalse(CollectionUtils.sizeIsEmpty(map)); } - // ----------------------------------------------------------------------- @Test public void testSizeIsEmpty_Null() { assertTrue(CollectionUtils.sizeIsEmpty(null)); @@ -2198,7 +2190,6 @@ public class CollectionUtilsTest extends MockTestCase { "Expecting NullPointerException for null collection."); } - // ----------------------------------------------------------------------- @Test public void testTransformedCollection() { final Transformer transformer = TransformerUtils.nopTransformer(); diff --git a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java index 45150fab4..37a0f758d 100644 --- a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java @@ -40,9 +40,6 @@ import org.junit.jupiter.api.Test; */ public class FactoryUtilsTest { - // exceptionFactory - //------------------------------------------------------------------ - @Test public void testExceptionFactory() { assertNotNull(FactoryUtils.exceptionFactory()); @@ -51,9 +48,6 @@ public class FactoryUtilsTest { assertThrows(FunctorException.class, () -> FactoryUtils.exceptionFactory().create()); } - // nullFactory - //------------------------------------------------------------------ - @Test public void testNullFactory() { final Factory factory = FactoryUtils.nullFactory(); @@ -62,9 +56,6 @@ public class FactoryUtilsTest { assertNull(created); } - // constantFactory - //------------------------------------------------------------------ - @Test public void testConstantFactoryNull() { final Factory factory = FactoryUtils.constantFactory(null); @@ -82,9 +73,6 @@ public class FactoryUtilsTest { assertSame(constant, created); } - // prototypeFactory - //------------------------------------------------------------------ - @Test public void testPrototypeFactoryNull() { assertSame(ConstantFactory.NULL_INSTANCE, FactoryUtils.prototypeFactory(null)); @@ -190,9 +178,6 @@ public class FactoryUtilsTest { } } - // instantiateFactory - //------------------------------------------------------------------ - @Test public void instantiateFactoryNull() { assertThrows(NullPointerException.class, () -> FactoryUtils.instantiateFactory(null)); @@ -231,9 +216,6 @@ public class FactoryUtilsTest { assertEquals(new Date(1000 * 60 * 60 * 24), created); } - // misc tests - //------------------------------------------------------------------ - /** * Test that all Factory singletons hold singleton pattern in * serialization/deserialization process. diff --git a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java index 72327cce3..082c327e6 100644 --- a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java +++ b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java @@ -105,7 +105,6 @@ public class FluentIterableTest { private static final Predicate EVEN = input -> input.intValue() % 2 == 0; - // ----------------------------------------------------------------------- @Test public void factoryMethodOf() { FluentIterable iterable = FluentIterable.of(1, 2, 3, 4, 5); diff --git a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java index a6498107b..01b9c9bac 100644 --- a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java @@ -97,7 +97,6 @@ public class IterableUtilsTest { private static final Predicate EVEN = input -> input.intValue() % 2 == 0; - // ----------------------------------------------------------------------- @Test public void forEach() { final List listA = new ArrayList<>(); diff --git a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java index 1a2fd0d62..ea26a4805 100644 --- a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java @@ -511,7 +511,6 @@ public class IteratorUtilsTest { assertThrows(NullPointerException.class, () -> IteratorUtils.collatedIterator(null, arrayList.iterator(), arrayList.listIterator(), null)); } - // ----------------------------------------------------------------------- /** * Test empty iterator */ @@ -534,7 +533,6 @@ public class IteratorUtilsTest { ); } - // ----------------------------------------------------------------------- /** * Test empty list iterator */ @@ -562,7 +560,6 @@ public class IteratorUtilsTest { ); } - // ----------------------------------------------------------------------- /** * Test empty map iterator */ @@ -589,7 +586,6 @@ public class IteratorUtilsTest { ); } - // ----------------------------------------------------------------------- /** * Test empty map iterator */ @@ -614,7 +610,6 @@ public class IteratorUtilsTest { ); } - // ----------------------------------------------------------------------- /** * Test empty map iterator */ @@ -686,7 +681,6 @@ public class IteratorUtilsTest { assertEquals(1, (int) IteratorUtils.first(iterator)); } - // ----------------------------------------------------------------------- @Test public void testForEach() { final List listA = new ArrayList<>(); @@ -994,7 +988,6 @@ public class IteratorUtilsTest { "remove() should throw an UnsupportedOperationException"); } - // ----------------------------------------------------------------------- /** * Test next() and hasNext() for an immutable Iterator. */ diff --git a/src/test/java/org/apache/commons/collections4/MapPerformance.java b/src/test/java/org/apache/commons/collections4/MapPerformance.java index f19ba1fcc..b0cb967cd 100644 --- a/src/test/java/org/apache/commons/collections4/MapPerformance.java +++ b/src/test/java/org/apache/commons/collections4/MapPerformance.java @@ -128,8 +128,6 @@ public class MapPerformance { System.out.println(name + (endMillis - startMillis)); } - // ---------------------------------------------------------------------- - private static class DummyMap implements Map { @Override public void clear() { diff --git a/src/test/java/org/apache/commons/collections4/PredicateUtilsTest.java b/src/test/java/org/apache/commons/collections4/PredicateUtilsTest.java index e13cc0a88..0ceca827a 100644 --- a/src/test/java/org/apache/commons/collections4/PredicateUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/PredicateUtilsTest.java @@ -50,9 +50,6 @@ import org.junit.jupiter.api.Test; @SuppressWarnings("boxing") public class PredicateUtilsTest extends AbstractPredicateTest { - // exceptionPredicate - //------------------------------------------------------------------ - @Test public void testExceptionPredicate() { assertNotNull(PredicateUtils.exceptionPredicate()); @@ -63,9 +60,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(FunctorException.class, () -> PredicateUtils.exceptionPredicate().evaluate(cString)); } - // notNullPredicate - //------------------------------------------------------------------ - @Test public void testIsNotNullPredicate() { assertNotNull(PredicateUtils.notNullPredicate()); @@ -76,9 +70,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertTrue(PredicateUtils.notNullPredicate().evaluate(cInteger)); } - // identityPredicate - //------------------------------------------------------------------ - @Test public void testIdentityPredicate() { assertSame(nullPredicate(), PredicateUtils.identityPredicate(null)); @@ -90,9 +81,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertTrue(PredicateUtils.identityPredicate(cInteger).evaluate(cInteger)); } - // truePredicate - //------------------------------------------------------------------ - @Test public void testTruePredicate() { assertNotNull(TruePredicate.truePredicate()); @@ -103,9 +91,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertTrue(truePredicate().evaluate(cInteger)); } - // falsePredicate - //------------------------------------------------------------------ - @Test public void testFalsePredicate() { assertNotNull(FalsePredicate.falsePredicate()); @@ -116,9 +101,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertFalse(FalsePredicate.falsePredicate().evaluate(cInteger)); } - // notPredicate - //------------------------------------------------------------------ - @Test public void testNotPredicate() { assertNotNull(PredicateUtils.notPredicate(TruePredicate.truePredicate())); @@ -133,9 +115,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.notPredicate(null)); } - // andPredicate - //------------------------------------------------------------------ - @Test public void testAndPredicate() { assertTrue(PredicateUtils.andPredicate(truePredicate(), truePredicate()).evaluate(null)); @@ -149,9 +128,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.andPredicate(null, null)); } - // allPredicate - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testAllPredicate() { @@ -224,9 +200,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> AllPredicate.allPredicate(coll)); } - // orPredicate - //------------------------------------------------------------------ - @Test public void testOrPredicate() { assertTrue(PredicateUtils.orPredicate(truePredicate(), truePredicate()).evaluate(null)); @@ -240,9 +213,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.orPredicate(null, null)); } - // anyPredicate - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testAnyPredicate() { @@ -316,9 +286,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.anyPredicate(coll)); } - // eitherPredicate - //------------------------------------------------------------------ - @Test public void testEitherPredicate() { assertFalse(PredicateUtils.eitherPredicate(truePredicate(), truePredicate()).evaluate(null)); @@ -332,9 +299,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.eitherPredicate(null, null)); } - // onePredicate - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testOnePredicate() { @@ -407,9 +371,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.onePredicate(Arrays.asList(null, null))); } - // neitherPredicate - //------------------------------------------------------------------ - @Test public void testNeitherPredicate() { assertFalse(PredicateUtils.neitherPredicate(truePredicate(), truePredicate()).evaluate(null)); @@ -423,9 +384,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.neitherPredicate(null, null)); } - // nonePredicate - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testNonePredicate() { @@ -499,9 +457,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.nonePredicate(coll)); } - // instanceofPredicate - //------------------------------------------------------------------ - @Test public void testInstanceOfPredicate() { assertNotNull(PredicateUtils.instanceofPredicate(String.class)); @@ -511,9 +466,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertFalse(PredicateUtils.instanceofPredicate(String.class).evaluate(cInteger)); } - // uniquePredicate - //------------------------------------------------------------------ - @Test public void testUniquePredicate() { final Predicate p = PredicateUtils.uniquePredicate(); @@ -525,9 +477,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertFalse(p.evaluate(cString)); } - // asPredicate(Transformer) - //------------------------------------------------------------------ - @Test public void testAsPredicateTransformer() { assertFalse(PredicateUtils.asPredicate(TransformerUtils.nopTransformer()).evaluate(false)); @@ -544,9 +493,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(FunctorException.class, () -> PredicateUtils.asPredicate(TransformerUtils.nopTransformer()).evaluate(null)); } - // invokerPredicate - //------------------------------------------------------------------ - @Test public void testInvokerPredicate() { final List list = new ArrayList<>(); @@ -570,9 +516,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(FunctorException.class, () -> PredicateUtils.invokerPredicate("noSuchMethod").evaluate(new Object())); } - // invokerPredicate2 - //------------------------------------------------------------------ - @Test public void testInvokerPredicate2() { final List list = new ArrayList<>(); @@ -600,9 +543,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { "noSuchMethod", new Class[] {Object.class}, new Object[] {cString}).evaluate(new Object())); } - // nullIsException - //------------------------------------------------------------------ - @Test public void testNullIsExceptionPredicate() { assertTrue(PredicateUtils.nullIsExceptionPredicate(truePredicate()).evaluate(new Object())); @@ -614,9 +554,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsExceptionPredicate(null)); } - // nullIsTrue - //------------------------------------------------------------------ - @Test public void testNullIsTruePredicate() { assertTrue(PredicateUtils.nullIsTruePredicate(truePredicate()).evaluate(null)); @@ -629,9 +566,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsTruePredicate(null)); } - // nullIsFalse - //------------------------------------------------------------------ - @Test public void testNullIsFalsePredicate() { assertFalse(PredicateUtils.nullIsFalsePredicate(truePredicate()).evaluate(null)); @@ -644,9 +578,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.nullIsFalsePredicate(null)); } - // transformed - //------------------------------------------------------------------ - @Test public void testTransformedPredicate() { assertTrue(PredicateUtils.transformedPredicate( @@ -663,9 +594,6 @@ public class PredicateUtilsTest extends AbstractPredicateTest { assertThrows(NullPointerException.class, () -> PredicateUtils.transformedPredicate(null, null)); } - // misc tests - //------------------------------------------------------------------ - /** * Test that all Predicate singletons hold singleton pattern in * serialization/deserialization process. diff --git a/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java b/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java index 4b86ae111..5b4341167 100644 --- a/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java @@ -38,8 +38,6 @@ public class QueueUtilsTest { protected Predicate truePredicate = TruePredicate.truePredicate(); protected Transformer nopTransformer = TransformerUtils.nopTransformer(); - // ---------------------------------------------------------------------- - @Test public void testSynchronizedQueue() { final Queue queue = QueueUtils.synchronizedQueue(new LinkedList<>()); diff --git a/src/test/java/org/apache/commons/collections4/SplitMapUtilsTest.java b/src/test/java/org/apache/commons/collections4/SplitMapUtilsTest.java index 43e5e8759..d5d6e080b 100644 --- a/src/test/java/org/apache/commons/collections4/SplitMapUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/SplitMapUtilsTest.java @@ -54,8 +54,6 @@ public class SplitMapUtilsTest { } } - // ----------------------------------------------------------------------- - @Test public void testReadableMap() { final IterableMap map = SplitMapUtils.readableMap(transformedMap); diff --git a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java index 1b89cec69..c5a75c0bc 100644 --- a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java @@ -51,9 +51,6 @@ public class TransformerUtilsTest { private static final Object cString = "Hello"; private static final Object cInteger = Integer.valueOf(6); - // exceptionTransformer - //------------------------------------------------------------------ - @Test public void testExceptionTransformer() { assertAll( @@ -64,9 +61,6 @@ public class TransformerUtilsTest { ); } - // nullTransformer - //------------------------------------------------------------------ - @Test public void testNullTransformer() { assertNotNull(TransformerUtils.nullTransformer()); @@ -77,9 +71,6 @@ public class TransformerUtilsTest { assertNull(TransformerUtils.nullTransformer().transform(cInteger)); } - // nopTransformer - //------------------------------------------------------------------ - @Test public void testNopTransformer() { assertNotNull(TransformerUtils.nullTransformer()); @@ -90,9 +81,6 @@ public class TransformerUtilsTest { assertEquals(cInteger, TransformerUtils.nopTransformer().transform(cInteger)); } - // constantTransformer - //------------------------------------------------------------------ - @Test public void testConstantTransformer() { assertEquals(cObject, TransformerUtils.constantTransformer(cObject).transform(null)); @@ -102,9 +90,6 @@ public class TransformerUtilsTest { assertSame(ConstantTransformer.NULL_INSTANCE, TransformerUtils.constantTransformer(null)); } - // cloneTransformer - //------------------------------------------------------------------ - @Test public void testCloneTransformer() { assertNull(TransformerUtils.cloneTransformer().transform(null)); @@ -114,9 +99,6 @@ public class TransformerUtilsTest { assertThrows(IllegalArgumentException.class, () -> assertEquals(cObject, TransformerUtils.cloneTransformer().transform(cObject))); } - // mapTransformer - //------------------------------------------------------------------ - @Test @SuppressWarnings("boxing") // OK in test code public void testMapTransformer() { @@ -131,9 +113,6 @@ public class TransformerUtilsTest { assertSame(ConstantTransformer.NULL_INSTANCE, TransformerUtils.mapTransformer(null)); } - // commandTransformer - //------------------------------------------------------------------ - @Test public void testExecutorTransformer() { assertNull(TransformerUtils.asTransformer(ClosureUtils.nopClosure()).transform(null)); @@ -144,9 +123,6 @@ public class TransformerUtilsTest { assertThrows(NullPointerException.class, () -> TransformerUtils.asTransformer((Closure) null)); } - // predicateTransformer - //------------------------------------------------------------------ - @Test public void testPredicateTransformer() { assertEquals(Boolean.TRUE, TransformerUtils.asTransformer(TruePredicate.truePredicate()).transform(null)); @@ -157,9 +133,6 @@ public class TransformerUtilsTest { assertThrows(IllegalArgumentException.class, () -> TransformerUtils.asTransformer((Predicate) null)); } - // factoryTransformer - //------------------------------------------------------------------ - @Test public void testFactoryTransformer() { assertNull(TransformerUtils.asTransformer(FactoryUtils.nullFactory()).transform(null)); @@ -170,9 +143,6 @@ public class TransformerUtilsTest { assertThrows(NullPointerException.class, () -> TransformerUtils.asTransformer((Factory) null)); } - // chainedTransformer - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testChainedTransformer() { @@ -203,9 +173,6 @@ public class TransformerUtilsTest { ); } - // ifTransformer - //------------------------------------------------------------------ - @Test public void testIfTransformer() { final Transformer a = TransformerUtils.constantTransformer("A"); @@ -232,9 +199,6 @@ public class TransformerUtilsTest { ); } - // switchTransformer - //------------------------------------------------------------------ - @Test @SuppressWarnings("unchecked") public void testSwitchTransformer() { @@ -284,9 +248,6 @@ public class TransformerUtilsTest { ); } - // switchMapTransformer - //------------------------------------------------------------------ - @Test public void testSwitchMapTransformer() { final Transformer a = TransformerUtils.constantTransformer("A"); @@ -310,9 +271,6 @@ public class TransformerUtilsTest { assertThrows(NullPointerException.class, () -> TransformerUtils.switchMapTransformer(null)); } - // invokerTransformer - //------------------------------------------------------------------ - @Test public void testInvokerTransformer() { final List list = new ArrayList<>(); @@ -326,9 +284,6 @@ public class TransformerUtilsTest { ); } - // invokerTransformer2 - //------------------------------------------------------------------ - @Test public void testInvokerTransformer2() { final List list = new ArrayList<>(); @@ -349,9 +304,6 @@ public class TransformerUtilsTest { ); } - // stringValueTransformer - //------------------------------------------------------------------ - @Test public void testStringValueTransformer() { assertNotNull( "StringValueTransformer should NEVER return a null value.", @@ -362,9 +314,6 @@ public class TransformerUtilsTest { TransformerUtils.stringValueTransformer().transform(6), "StringValueTransformer should return toString value"); } - // instantiateFactory - //------------------------------------------------------------------ - @Test public void testInstantiateTransformerNull() { assertAll( @@ -384,9 +333,6 @@ public class TransformerUtilsTest { assertEquals(new Date(1000L), trans.transform(Date.class)); } - // misc tests - //------------------------------------------------------------------ - /** * Test that all Transformer singletons hold singleton pattern in * serialization/deserialization process. diff --git a/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java b/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java index 45fb669ef..6a8cc3cc2 100644 --- a/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; */ public class TrieUtilsTest { - //---------------------------------------------------------------------- - @Test public void testUnmodifiableTrie() { final Trie trie = TrieUtils.unmodifiableTrie(new PatriciaTrie<>()); diff --git a/src/test/java/org/apache/commons/collections4/bag/PredicatedBagTest.java b/src/test/java/org/apache/commons/collections4/bag/PredicatedBagTest.java index 4f0a5f7cd..56706077c 100644 --- a/src/test/java/org/apache/commons/collections4/bag/PredicatedBagTest.java +++ b/src/test/java/org/apache/commons/collections4/bag/PredicatedBagTest.java @@ -42,8 +42,6 @@ public class PredicatedBagTest extends AbstractBagTest { return BulkTest.makeSuite(PredicatedBagTest.class); } - //-------------------------------------------------------------------------- - protected Predicate stringPredicate() { return o -> o instanceof String; } @@ -63,8 +61,6 @@ public class PredicatedBagTest extends AbstractBagTest { return decorateBag(new HashBag(), stringPredicate()); } - //-------------------------------------------------------------------------- - @Test @SuppressWarnings("unchecked") public void testlegalAddRemove() { diff --git a/src/test/java/org/apache/commons/collections4/bag/PredicatedSortedBagTest.java b/src/test/java/org/apache/commons/collections4/bag/PredicatedSortedBagTest.java index 8300bd609..f0e4aacb3 100644 --- a/src/test/java/org/apache/commons/collections4/bag/PredicatedSortedBagTest.java +++ b/src/test/java/org/apache/commons/collections4/bag/PredicatedSortedBagTest.java @@ -44,8 +44,6 @@ public class PredicatedSortedBagTest extends AbstractSortedBagTest { return BulkTest.makeSuite(PredicatedSortedBagTest.class); } - //-------------------------------------------------------------------------- - protected Predicate stringPredicate() { return o -> o instanceof String; } @@ -65,8 +63,6 @@ public class PredicatedSortedBagTest extends AbstractSortedBagTest { return decorateBag(new TreeBag(), stringPredicate()); } - //-------------------------------------------------------------------------- - @Test public void testDecorate() { final SortedBag bag = decorateBag(new TreeBag(), stringPredicate()); diff --git a/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java index 600c01495..43b9cc920 100644 --- a/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java +++ b/src/test/java/org/apache/commons/collections4/collection/CompositeCollectionTest.java @@ -58,7 +58,6 @@ public class CompositeCollectionTest extends AbstractCollectionTest { return (E[]) new Object[] { "1", "2", "3", "4" }; } - //----------------------------------------------------------------------------- /** * Run stock collection tests without Mutator, so turn off add, remove */ @@ -77,8 +76,6 @@ public class CompositeCollectionTest extends AbstractCollectionTest { return new HashSet<>(); } - //-------------------------------------------------------------------------- - /** * Full collection should look like a collection with 4 elements */ diff --git a/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java index e7d42109c..6106f500a 100644 --- a/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java +++ b/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java @@ -40,8 +40,6 @@ public class IndexedCollectionTest extends AbstractCollectionTest { super(IndexedCollectionTest.class.getSimpleName()); } - //------------------------------------------------------------------------ - protected Collection decorateCollection(final Collection collection) { return IndexedCollection.nonUniqueIndexedCollection(collection, new IntegerTransformer()); } @@ -103,8 +101,6 @@ public class IndexedCollectionTest extends AbstractCollectionTest { return true; } - //------------------------------------------------------------------------ - @Test public void testAddedObjectsCanBeRetrievedByKey() throws Exception { final Collection coll = makeTestCollection(); diff --git a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionTest.java index 41128de2f..5a8fef935 100644 --- a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionTest.java +++ b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionTest.java @@ -39,7 +39,6 @@ public class PredicatedCollectionTest extends AbstractCollectionTest { super(PredicatedCollectionTest.class.getSimpleName()); } - //------------------------------------------------------------------------ protected Predicate truePredicate = TruePredicate.truePredicate(); protected Collection decorateCollection( diff --git a/src/test/java/org/apache/commons/collections4/comparators/BooleanComparatorTest.java b/src/test/java/org/apache/commons/collections4/comparators/BooleanComparatorTest.java index 629dede77..863222b84 100644 --- a/src/test/java/org/apache/commons/collections4/comparators/BooleanComparatorTest.java +++ b/src/test/java/org/apache/commons/collections4/comparators/BooleanComparatorTest.java @@ -33,16 +33,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; @SuppressWarnings("boxing") public class BooleanComparatorTest extends AbstractComparatorTest { - // conventional - // ------------------------------------------------------------------------ - public BooleanComparatorTest() { super(BooleanComparatorTest.class.getSimpleName()); } - // collections testing framework - // ------------------------------------------------------------------------ - @Override public Comparator makeObject() { return new BooleanComparator(); @@ -63,9 +57,6 @@ public class BooleanComparatorTest extends AbstractComparatorTest { // writeExternalFormToDisk((java.io.Serializable) makeObject(), "src/test/resources/data/test/BooleanComparator.version4.obj"); // } - // tests - // ------------------------------------------------------------------------ - @Test public void testConstructors() { allTests(false, new BooleanComparator()); @@ -96,9 +87,6 @@ public class BooleanComparatorTest extends AbstractComparatorTest { assertNotEquals(new BooleanComparator(true), new BooleanComparator(false)); } - // utilities - // ------------------------------------------------------------------------ - protected void allTests(final boolean trueFirst, final BooleanComparator comp) { orderIndependentTests(comp); if (trueFirst) { diff --git a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java index e0a4f9d61..331afbdde 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java @@ -64,8 +64,6 @@ public class PushbackIteratorTest extends AbstractIteratorTest { return false; } - // ----------------------------------------------------------------------- - @Test public void testNormalIteration() { final PushbackIterator iter = makeObject(); diff --git a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java index 57839830b..607dc1060 100644 --- a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java @@ -1193,7 +1193,6 @@ public abstract class AbstractListTest extends AbstractCollectionTest { m.getName() + " raised unexpected " + thrown.getTargetException()); } - // ----------------------------------------------------------------------- public BulkTest bulkTestListIterator() { return new TestListIterator(); } diff --git a/src/test/java/org/apache/commons/collections4/list/PredicatedListTest.java b/src/test/java/org/apache/commons/collections4/list/PredicatedListTest.java index 87259fc32..a11159b52 100644 --- a/src/test/java/org/apache/commons/collections4/list/PredicatedListTest.java +++ b/src/test/java/org/apache/commons/collections4/list/PredicatedListTest.java @@ -37,8 +37,6 @@ public class PredicatedListTest extends AbstractListTest { super(PredicatedListTest.class.getSimpleName()); } - //------------------------------------------------------------------- - protected Predicate truePredicate = TruePredicate.truePredicate(); protected List decorateList(final List list, final Predicate predicate) { @@ -56,8 +54,6 @@ public class PredicatedListTest extends AbstractListTest { return (E[]) new Object[] { "1", "3", "5", "7", "2", "4", "6" }; } -//-------------------------------------------------------------------- - protected Predicate testPredicate = o -> o instanceof String; diff --git a/src/test/java/org/apache/commons/collections4/map/UnmodifiableMapTest.java b/src/test/java/org/apache/commons/collections4/map/UnmodifiableMapTest.java index 45530feb9..fea292b0b 100644 --- a/src/test/java/org/apache/commons/collections4/map/UnmodifiableMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/UnmodifiableMapTest.java @@ -37,8 +37,6 @@ public class UnmodifiableMapTest extends AbstractIterableMapTest { super(UnmodifiableMapTest.class.getSimpleName()); } - //------------------------------------------------------------------- - @Override public IterableMap makeObject() { return (IterableMap) UnmodifiableMap.unmodifiableMap(new HashMap()); diff --git a/src/test/java/org/apache/commons/collections4/map/UnmodifiableOrderedMapTest.java b/src/test/java/org/apache/commons/collections4/map/UnmodifiableOrderedMapTest.java index 9cbc506cb..a67a3bb05 100644 --- a/src/test/java/org/apache/commons/collections4/map/UnmodifiableOrderedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/UnmodifiableOrderedMapTest.java @@ -36,8 +36,6 @@ public class UnmodifiableOrderedMapTest extends AbstractOrderedMapTest makeObject() { return UnmodifiableOrderedMap.unmodifiableOrderedMap(ListOrderedMap.listOrderedMap(new HashMap())); diff --git a/src/test/java/org/apache/commons/collections4/map/UnmodifiableSortedMapTest.java b/src/test/java/org/apache/commons/collections4/map/UnmodifiableSortedMapTest.java index efe91f3f7..346cc0e87 100644 --- a/src/test/java/org/apache/commons/collections4/map/UnmodifiableSortedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/map/UnmodifiableSortedMapTest.java @@ -36,8 +36,6 @@ public class UnmodifiableSortedMapTest extends AbstractSortedMapTest super(UnmodifiableSortedMapTest.class.getSimpleName()); } - //------------------------------------------------------------------- - @Override public SortedMap makeObject() { return UnmodifiableSortedMap.unmodifiableSortedMap(new TreeMap()); diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java index ab5d28f2f..a3723faa4 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java @@ -449,7 +449,6 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes assertEquals(6, makeFullMap().size()); } - // ----------------------------------------------------------------------- @Test @SuppressWarnings("unchecked") public void testMapEquals() { @@ -843,11 +842,9 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes } } - // ----------------------------------------------------------------------- - // Manual serialization testing as this class cannot easily - // extend the AbstractTestMap - // ----------------------------------------------------------------------- - + /** + * Manual serialization testing as this class cannot easily extend the AbstractTestMap + */ @Test public void testEmptyMapCompatibility() throws Exception { final MultiValuedMap map = makeObject(); diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java index e83f20355..aac4a26b4 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java @@ -43,13 +43,11 @@ public class ArrayListValuedHashMapTest extends AbstractMultiValuedMapTest return BulkTest.makeSuite(ArrayListValuedHashMapTest.class); } - // ----------------------------------------------------------------------- @Override public ListValuedMap makeObject() { return new ArrayListValuedHashMap<>(); } - // ----------------------------------------------------------------------- @Test @SuppressWarnings("unchecked") public void testListValuedMapAdd() { diff --git a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java index 3c76ef22b..fc9da211a 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java @@ -41,7 +41,6 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest makeObject() { return new HashSetValuedHashMap<>(); @@ -57,7 +56,6 @@ public class HashSetValuedHashMapTest extends AbstractMultiValuedMapTest extends AbstractMultiValuedMapT return BulkTest.makeSuite(TransformedMultiValuedMapTest.class); } - // ----------------------------------------------------------------------- @Override public MultiValuedMap makeObject() { return TransformedMultiValuedMap.transformingMap(new ArrayListValuedHashMap(), TransformerUtils.nopTransformer(), TransformerUtils.nopTransformer()); } - // ----------------------------------------------------------------------- @Test @SuppressWarnings("unchecked") public void testKeyTransformedMap() { @@ -93,7 +91,6 @@ public class TransformedMultiValuedMapTest extends AbstractMultiValuedMapT assertTrue(map.remove(els[0]).contains(Integer.valueOf((String) els[0]))); } - // ----------------------------------------------------------------------- @Test @SuppressWarnings("unchecked") public void testFactory_Decorate() { diff --git a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java index 55082fc69..dbae6e937 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java @@ -82,7 +82,6 @@ public class UnmodifiableMultiValuedMapTest extends AbstractMultiValuedMap return UnmodifiableMultiValuedMap.unmodifiableMultiValuedMap(map); } - // ----------------------------------------------------------------------- @Test public void testUnmodifiable() { assertTrue(makeObject() instanceof Unmodifiable); diff --git a/src/test/java/org/apache/commons/collections4/multiset/PredicatedMultiSetTest.java b/src/test/java/org/apache/commons/collections4/multiset/PredicatedMultiSetTest.java index 590788bc7..853c52096 100644 --- a/src/test/java/org/apache/commons/collections4/multiset/PredicatedMultiSetTest.java +++ b/src/test/java/org/apache/commons/collections4/multiset/PredicatedMultiSetTest.java @@ -42,8 +42,6 @@ public class PredicatedMultiSetTest extends AbstractMultiSetTest { return BulkTest.makeSuite(PredicatedMultiSetTest.class); } - //-------------------------------------------------------------------------- - protected Predicate stringPredicate() { return o -> o instanceof String; } @@ -63,8 +61,6 @@ public class PredicatedMultiSetTest extends AbstractMultiSetTest { return decorateMultiSet(new HashMultiSet(), stringPredicate()); } - //-------------------------------------------------------------------------- - @Test @SuppressWarnings("unchecked") public void testLegalAddRemove() { diff --git a/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java index dd61cbfef..370659cd6 100644 --- a/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java +++ b/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java @@ -39,8 +39,6 @@ public class PredicatedQueueTest extends AbstractQueueTest { super(PredicatedQueueTest.class.getSimpleName()); } - //--------------------------------------------------------------- - protected Predicate truePredicate = TruePredicate.truePredicate(); protected Queue decorateCollection(final Queue queue, final Predicate predicate) { @@ -69,8 +67,6 @@ public class PredicatedQueueTest extends AbstractQueueTest { return list; } - //------------------------------------------------------------ - protected Predicate testPredicate = o -> o instanceof String; public Queue makeTestQueue() { diff --git a/src/test/java/org/apache/commons/collections4/queue/SynchronizedQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/SynchronizedQueueTest.java index b8b2a7546..0d08ffa6f 100644 --- a/src/test/java/org/apache/commons/collections4/queue/SynchronizedQueueTest.java +++ b/src/test/java/org/apache/commons/collections4/queue/SynchronizedQueueTest.java @@ -38,8 +38,6 @@ public class SynchronizedQueueTest extends AbstractQueueTest { super(SynchronizedQueueTest.class.getSimpleName()); } - // ----------------------------------------------------------------------- - @Override public String getCompatibilityVersion() { return "4.2"; diff --git a/src/test/java/org/apache/commons/collections4/set/PredicatedNavigableSetTest.java b/src/test/java/org/apache/commons/collections4/set/PredicatedNavigableSetTest.java index 3aa58205e..27cf16449 100644 --- a/src/test/java/org/apache/commons/collections4/set/PredicatedNavigableSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/PredicatedNavigableSetTest.java @@ -45,8 +45,6 @@ public class PredicatedNavigableSetTest extends AbstractNavigableSetTest { return BulkTest.makeSuite(PredicatedNavigableSetTest.class); } - //------------------------------------------------------------------- - protected Predicate truePredicate = TruePredicate.truePredicate(); @Override @@ -60,7 +58,6 @@ public class PredicatedNavigableSetTest extends AbstractNavigableSetTest { return PredicatedNavigableSet.predicatedNavigableSet(set, truePredicate); } -//-------------------------------------------------------------------- protected Predicate testPredicate = o -> o instanceof String && ((String) o).startsWith("A"); diff --git a/src/test/java/org/apache/commons/collections4/set/PredicatedSetTest.java b/src/test/java/org/apache/commons/collections4/set/PredicatedSetTest.java index 085a9d5b0..d3c4e38c6 100644 --- a/src/test/java/org/apache/commons/collections4/set/PredicatedSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/PredicatedSetTest.java @@ -37,8 +37,6 @@ public class PredicatedSetTest extends AbstractSetTest { super(PredicatedSetTest.class.getSimpleName()); } - //------------------------------------------------------------------- - protected Predicate truePredicate = TruePredicate.truePredicate(); protected PredicatedSet decorateSet(final Set set, final Predicate predicate) { @@ -56,8 +54,6 @@ public class PredicatedSetTest extends AbstractSetTest { return (E[]) new Object[] {"1", "3", "5", "7", "2", "4", "6"}; } -//-------------------------------------------------------------------- - protected Predicate testPredicate = o -> o instanceof String; diff --git a/src/test/java/org/apache/commons/collections4/set/UnmodifiableNavigableSetTest.java b/src/test/java/org/apache/commons/collections4/set/UnmodifiableNavigableSetTest.java index c74fea4d2..d8748baa1 100644 --- a/src/test/java/org/apache/commons/collections4/set/UnmodifiableNavigableSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/UnmodifiableNavigableSetTest.java @@ -46,7 +46,6 @@ public class UnmodifiableNavigableSetTest extends AbstractNavigableSetTest return BulkTest.makeSuite(UnmodifiableNavigableSetTest.class); } - //------------------------------------------------------------------- @Override public NavigableSet makeObject() { return UnmodifiableNavigableSet.unmodifiableNavigableSet(new TreeSet<>()); @@ -68,7 +67,6 @@ public class UnmodifiableNavigableSetTest extends AbstractNavigableSetTest return false; } - //-------------------------------------------------------------------- @SuppressWarnings("unchecked") protected void setupSet() { set = makeFullCollection(); diff --git a/src/test/java/org/apache/commons/collections4/set/UnmodifiableSetTest.java b/src/test/java/org/apache/commons/collections4/set/UnmodifiableSetTest.java index a99f269a4..a1e12eb11 100644 --- a/src/test/java/org/apache/commons/collections4/set/UnmodifiableSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/UnmodifiableSetTest.java @@ -42,7 +42,6 @@ public class UnmodifiableSetTest extends AbstractSetTest { return BulkTest.makeSuite(UnmodifiableSetTest.class); } - //------------------------------------------------------------------- @Override public Set makeObject() { return UnmodifiableSet.unmodifiableSet(new HashSet()); diff --git a/src/test/java/org/apache/commons/collections4/set/UnmodifiableSortedSetTest.java b/src/test/java/org/apache/commons/collections4/set/UnmodifiableSortedSetTest.java index cccc35553..d7d866977 100644 --- a/src/test/java/org/apache/commons/collections4/set/UnmodifiableSortedSetTest.java +++ b/src/test/java/org/apache/commons/collections4/set/UnmodifiableSortedSetTest.java @@ -47,7 +47,6 @@ public class UnmodifiableSortedSetTest extends AbstractSortedSetTest { return BulkTest.makeSuite(UnmodifiableSortedSetTest.class); } - //------------------------------------------------------------------- @Override public SortedSet makeObject() { return UnmodifiableSortedSet.unmodifiableSortedSet(new TreeSet()); @@ -69,7 +68,6 @@ public class UnmodifiableSortedSetTest extends AbstractSortedSetTest { return false; } - //-------------------------------------------------------------------- @SuppressWarnings("unchecked") protected void setupSet() { set = makeFullCollection(); diff --git a/src/test/java/org/apache/commons/collections4/splitmap/TransformedSplitMapTest.java b/src/test/java/org/apache/commons/collections4/splitmap/TransformedSplitMapTest.java index 6d57b5bca..6056aeb75 100644 --- a/src/test/java/org/apache/commons/collections4/splitmap/TransformedSplitMapTest.java +++ b/src/test/java/org/apache/commons/collections4/splitmap/TransformedSplitMapTest.java @@ -46,7 +46,6 @@ public class TransformedSplitMapTest extends BulkTest { super(TransformedSplitMapTest.class.getSimpleName()); } - // ----------------------------------------------------------------------- @Test public void testTransformedMap() { final TransformedSplitMap> map = TransformedSplitMap.transformingMap( @@ -90,8 +89,6 @@ public class TransformedSplitMapTest extends BulkTest { assertEquals(--sz2, map2.size()); } - // ----------------------------------------------------------------------- - @Test public void testMapIterator() { final TransformedSplitMap map = diff --git a/src/test/java/org/apache/commons/collections4/trie/UnmodifiableTrieTest.java b/src/test/java/org/apache/commons/collections4/trie/UnmodifiableTrieTest.java index 41064608e..6f3019b1e 100644 --- a/src/test/java/org/apache/commons/collections4/trie/UnmodifiableTrieTest.java +++ b/src/test/java/org/apache/commons/collections4/trie/UnmodifiableTrieTest.java @@ -40,8 +40,6 @@ public class UnmodifiableTrieTest extends AbstractSortedMapTest { return BulkTest.makeSuite(UnmodifiableTrieTest.class); } - //------------------------------------------------------------------- - @Override public Trie makeObject() { return UnmodifiableTrie.unmodifiableTrie(new PatriciaTrie());