diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index d4b8cff4ba..0b543f10e3 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -59,6 +59,7 @@ limitations under the License.
+
diff --git a/src/main/java/org/apache/commons/collections4/BagUtils.java b/src/main/java/org/apache/commons/collections4/BagUtils.java
index 225437a233..2cffccf587 100644
--- a/src/main/java/org/apache/commons/collections4/BagUtils.java
+++ b/src/main/java/org/apache/commons/collections4/BagUtils.java
@@ -263,5 +263,8 @@ public static SortedBag unmodifiableSortedBag(final SortedBag bag) {
/**
* Don't allow instances.
*/
- private BagUtils() {}
+ private BagUtils() {
+ // empty
+ }
+
}
diff --git a/src/main/java/org/apache/commons/collections4/ClosureUtils.java b/src/main/java/org/apache/commons/collections4/ClosureUtils.java
index 819e444167..def04ea9c9 100644
--- a/src/main/java/org/apache/commons/collections4/ClosureUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ClosureUtils.java
@@ -370,6 +370,8 @@ public static Closure whileClosure(final Predicate super E> predicate,
/**
* Don't allow instances.
*/
- private ClosureUtils() {}
+ private ClosureUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 5a62e92697..5283c17357 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -2151,5 +2151,7 @@ public static Collection unmodifiableCollection(final Collection extend
/**
* Don't allow instances.
*/
- private CollectionUtils() {}
+ private CollectionUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/ComparatorUtils.java b/src/main/java/org/apache/commons/collections4/ComparatorUtils.java
index 826c3a3613..90dbb259e5 100644
--- a/src/main/java/org/apache/commons/collections4/ComparatorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ComparatorUtils.java
@@ -238,6 +238,8 @@ public static Comparator transformedComparator(Comparator comparato
/**
* Don't allow instances.
*/
- private ComparatorUtils() {}
+ private ComparatorUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/FactoryUtils.java b/src/main/java/org/apache/commons/collections4/FactoryUtils.java
index 76c58ec2be..36d5679448 100644
--- a/src/main/java/org/apache/commons/collections4/FactoryUtils.java
+++ b/src/main/java/org/apache/commons/collections4/FactoryUtils.java
@@ -145,6 +145,8 @@ public static Factory prototypeFactory(final T prototype) {
/**
* Don't allow instances.
*/
- private FactoryUtils() {}
+ private FactoryUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index ecf5b21c53..5918e8c7ab 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -1438,6 +1438,8 @@ public static ZippingIterator zippingIterator(final Iterator extends E>
/**
* Don't allow instances.
*/
- private IteratorUtils() {}
+ private IteratorUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java
index f7eb95c5eb..1d24b1849a 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -744,5 +744,8 @@ public static List unmodifiableList(final List extends E> list) {
/**
* Don't allow instances.
*/
- private ListUtils() {}
+ private ListUtils() {
+ // empty
+ }
+
}
diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
index d17dd53de4..a91372722c 100644
--- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
@@ -240,6 +240,8 @@ public static MultiValuedMap unmodifiableMultiValuedMap(
/**
* Don't allow instances.
*/
- private MultiMapUtils() {}
+ private MultiMapUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/MultiSetUtils.java b/src/main/java/org/apache/commons/collections4/MultiSetUtils.java
index e472b72da5..f424236e22 100644
--- a/src/main/java/org/apache/commons/collections4/MultiSetUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiSetUtils.java
@@ -112,6 +112,8 @@ public static MultiSet unmodifiableMultiSet(final MultiSet extends E> m
/**
* Don't allow instances.
*/
- private MultiSetUtils() {}
+ private MultiSetUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/PredicateUtils.java b/src/main/java/org/apache/commons/collections4/PredicateUtils.java
index f5cec7ef1f..4cb824932f 100644
--- a/src/main/java/org/apache/commons/collections4/PredicateUtils.java
+++ b/src/main/java/org/apache/commons/collections4/PredicateUtils.java
@@ -380,7 +380,7 @@ public static Predicate notPredicate(final Predicate super T> predicate
* @throws NullPointerException if the predicate is null.
* @see NullIsExceptionPredicate
*/
- public static Predicate nullIsExceptionPredicate(final Predicate super T> predicate){
+ public static Predicate nullIsExceptionPredicate(final Predicate super T> predicate) {
return NullIsExceptionPredicate.nullIsExceptionPredicate(predicate);
}
@@ -395,7 +395,7 @@ public static Predicate nullIsExceptionPredicate(final Predicate super
* @throws NullPointerException if the predicate is null.
* @see NullIsFalsePredicate
*/
- public static Predicate nullIsFalsePredicate(final Predicate super T> predicate){
+ public static Predicate nullIsFalsePredicate(final Predicate super T> predicate) {
return NullIsFalsePredicate.nullIsFalsePredicate(predicate);
}
@@ -410,7 +410,7 @@ public static Predicate nullIsFalsePredicate(final Predicate super T> p
* @throws NullPointerException if the predicate is null.
* @see NullIsTruePredicate
*/
- public static Predicate nullIsTruePredicate(final Predicate super T> predicate){
+ public static Predicate nullIsTruePredicate(final Predicate super T> predicate) {
return NullIsTruePredicate.nullIsTruePredicate(predicate);
}
@@ -486,8 +486,7 @@ public static Predicate orPredicate(final Predicate super T> predicate1
* @see TransformedPredicate
* @since 3.1
*/
- public static Predicate transformedPredicate(
- final Transformer super T, ? extends T> transformer, final Predicate super T> predicate) {
+ public static Predicate transformedPredicate(final Transformer super T, ? extends T> transformer, final Predicate super T> predicate) {
return TransformedPredicate.transformedPredicate(transformer, predicate);
}
@@ -521,6 +520,8 @@ public static Predicate uniquePredicate() {
/**
* Don't allow instances.
*/
- private PredicateUtils() {}
+ private PredicateUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/QueueUtils.java b/src/main/java/org/apache/commons/collections4/QueueUtils.java
index 63e409cb1e..aff6a24194 100644
--- a/src/main/java/org/apache/commons/collections4/QueueUtils.java
+++ b/src/main/java/org/apache/commons/collections4/QueueUtils.java
@@ -113,8 +113,7 @@ public static Queue synchronizedQueue(final Queue queue) {
* @return a transformed queue backed by the given queue
* @throws NullPointerException if the queue or transformer is null
*/
- public static Queue transformingQueue(final Queue queue,
- final Transformer super E, ? extends E> transformer) {
+ public static Queue transformingQueue(final Queue queue, final Transformer super E, ? extends E> transformer) {
return TransformedQueue.transformingQueue(queue, transformer);
}
@@ -133,5 +132,7 @@ public static Queue unmodifiableQueue(final Queue extends E> queue) {
/**
* Don't allow instances.
*/
- private QueueUtils() {}
+ private QueueUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java
index c1317f0885..cf5e438b4c 100644
--- a/src/main/java/org/apache/commons/collections4/SetUtils.java
+++ b/src/main/java/org/apache/commons/collections4/SetUtils.java
@@ -652,5 +652,8 @@ public static SortedSet unmodifiableSortedSet(final SortedSet set) {
/**
* Don't allow instances.
*/
- private SetUtils() {}
+ private SetUtils() {
+ // empty
+ }
+
}
diff --git a/src/main/java/org/apache/commons/collections4/SplitMapUtils.java b/src/main/java/org/apache/commons/collections4/SplitMapUtils.java
index 2f77982a1c..b645d3049b 100644
--- a/src/main/java/org/apache/commons/collections4/SplitMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/SplitMapUtils.java
@@ -259,6 +259,8 @@ public static Map writableMap(final Put put) {
/**
* Don't allow instances.
*/
- private SplitMapUtils() {}
+ private SplitMapUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/TransformerUtils.java b/src/main/java/org/apache/commons/collections4/TransformerUtils.java
index 9d51a24f3f..7ad0b9f99d 100644
--- a/src/main/java/org/apache/commons/collections4/TransformerUtils.java
+++ b/src/main/java/org/apache/commons/collections4/TransformerUtils.java
@@ -480,6 +480,8 @@ public static Transformer switchTransformer(final Predicate super
/**
* This class is not normally instantiated.
*/
- private TransformerUtils() {}
+ private TransformerUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/TrieUtils.java b/src/main/java/org/apache/commons/collections4/TrieUtils.java
index 866c02eb67..e1c49db660 100644
--- a/src/main/java/org/apache/commons/collections4/TrieUtils.java
+++ b/src/main/java/org/apache/commons/collections4/TrieUtils.java
@@ -43,6 +43,8 @@ public static Trie unmodifiableTrie(final Trie trie
/**
* Don't allow instances.
*/
- private TrieUtils() {}
+ private TrieUtils() {
+ // empty
+ }
}
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 d1ddb23305..9ab69afa73 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
@@ -1969,13 +1969,13 @@ public void putAll(final Map extends K, ? extends V> map) {
* @throws ClassNotFoundException if an object read from the stream can not be loaded
*/
@SuppressWarnings("unchecked") // This will fail at runtime if the stream is incorrect
- private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException{
+ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
rootNode = new Node[2];
final int size = stream.readInt();
- for (int i = 0; i < size; i++){
- final K k =(K) stream.readObject();
- final V v =(V) stream.readObject();
+ for (int i = 0; i < size; i++) {
+ final K k = (K) stream.readObject();
+ final V v = (V) stream.readObject();
put(k, v);
}
}
@@ -2224,7 +2224,7 @@ public Set values() {
* @param stream the output stream
* @throws IOException if an error occurs while writing to the stream
*/
- private void writeObject(final ObjectOutputStream stream) throws IOException{
+ private void writeObject(final ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
stream.writeInt(this.size());
for (final Entry entry : entrySet()) {
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
index feb32a483d..41ec91058b 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java
@@ -166,7 +166,7 @@ default int estimateIntersection(final BloomFilter other) {
estimate = Math.round(eThis + eOther - eUnion);
estimate = estimate < 0 ? 0 : estimate;
}
- return estimate>Integer.MAX_VALUE?Integer.MAX_VALUE:(int) estimate;
+ return estimate > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) estimate;
}
/**
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/IndexUtils.java b/src/main/java/org/apache/commons/collections4/bloomfilter/IndexUtils.java
index bea31d733b..3c835ea570 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/IndexUtils.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/IndexUtils.java
@@ -42,6 +42,10 @@ static int[] ensureCapacityForAdd(final int[] array, final int index) {
return array;
}
- // do not instantiate
- private IndexUtils() {}
+ /**
+ * Don't instantiate.
+ */
+ private IndexUtils() {
+ // empty
+ }
}
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
index c16b0dad0c..f5500f747c 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java
@@ -125,8 +125,10 @@ public static final class Cleanup {
* A Cleanup that never removes anything.
* @return A Consumer suitable for the LayerManager {@code cleanup} parameter.
*/
- public static Consumer> noCleanup() {
- return x -> {};
+ public static Consumer> noCleanup() {
+ return x -> {
+ // empty
+ };
}
/**
diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java b/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
index f6ec7917f5..fcd03fb782 100644
--- a/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
+++ b/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java
@@ -45,7 +45,7 @@
public class ComparableComparator> implements Comparator, Serializable {
/** Serialization version. */
- private static final long serialVersionUID=-291439688585137865L;
+ private static final long serialVersionUID = -291439688585137865L;
/** The singleton instance. */
@SuppressWarnings("rawtypes")
diff --git a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
index 637b51e344..fc3788d7d5 100644
--- a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
+++ b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java
@@ -112,7 +112,7 @@ public IfTransformer(final Predicate super I> predicate,
*
* @return the predicate
*/
- public Predicate super I> getPredicate(){
+ public Predicate super I> getPredicate() {
return iPredicate;
}
@@ -133,7 +133,7 @@ public Predicate super I> getPredicate(){
*/
@Override
public O transform(final I input) {
- if (iPredicate.evaluate(input)){
+ if (iPredicate.evaluate(input)) {
return iTrueTransformer.transform(input);
}
return iFalseTransformer.transform(input);
diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
index 3c9839ca09..9a6b906e48 100644
--- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
+++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java
@@ -93,7 +93,7 @@ public static Closure switchClosure(final Predicate super E>[] predicat
throw new IllegalArgumentException("The predicate and closure arrays must be the same size");
}
if (predicates.length == 0) {
- return (Closure) (defaultClosure == null ? NOPClosure.nopClosure(): defaultClosure);
+ return (Closure) (defaultClosure == null ? NOPClosure.nopClosure() : defaultClosure);
}
return new SwitchClosure<>(predicates, closures, defaultClosure);
}
diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
index 0109df27c6..5aeb6f5754 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java
@@ -182,7 +182,7 @@ public E previous() {
@Override
public int previousIndex() {
- return nextIndex-1;
+ return nextIndex - 1;
}
/** Not supported. */
diff --git a/src/main/java/org/apache/commons/collections4/map/LRUMap.java b/src/main/java/org/apache/commons/collections4/map/LRUMap.java
index 1e91c3257a..c15ca6be54 100644
--- a/src/main/java/org/apache/commons/collections4/map/LRUMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/LRUMap.java
@@ -492,10 +492,8 @@ protected void reuseMapping(final LinkEntry entry, final int hashIndex, fi
reuseEntry(entry, hashIndex, hashCode, key, value);
addEntry(entry, hashIndex);
} catch (final NullPointerException ex) {
- throw new IllegalStateException(
- "NPE, entry=" + entry + " entryIsHeader=" + (entry==header) +
- " key=" + key + " value=" + value + " size=" + size + " maxSize=" + maxSize +
- " This should not occur if your keys are immutable, and you have used synchronization properly.");
+ throw new IllegalStateException("NPE, entry=" + entry + " entryIsHeader=" + (entry == header) + " key=" + key + " value=" + value + " size=" + size
+ + " maxSize=" + maxSize + " This should not occur if your keys are immutable, and you have used synchronization properly.");
}
}
diff --git a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java
index daa48c0f01..f1ec95659f 100644
--- a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java
+++ b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java
@@ -264,11 +264,11 @@ private Snake getMiddleSnake(final int start1, final int end1, final int start2,
return null;
}
- final int delta = m - n;
- final int sum = n + m;
+ final int delta = m - n;
+ final int sum = n + m;
final int offset = (sum % 2 == 0 ? sum : sum + 1) / 2;
- vDown[1+offset] = start1;
- vUp[1+offset] = end1 + 1;
+ vDown[1 + offset] = start1;
+ vUp[1 + offset] = end1 + 1;
for (int d = 0; d <= offset; ++d) {
// Down
@@ -276,10 +276,10 @@ private Snake getMiddleSnake(final int start1, final int end1, final int start2,
// First step
final int i = k + offset;
- if (k == -d || k != d && vDown[i-1] < vDown[i+1]) {
- vDown[i] = vDown[i+1];
+ if (k == -d || k != d && vDown[i - 1] < vDown[i + 1]) {
+ vDown[i] = vDown[i + 1];
} else {
- vDown[i] = vDown[i-1] + 1;
+ vDown[i] = vDown[i - 1] + 1;
}
int x = vDown[i];
@@ -290,8 +290,8 @@ private Snake getMiddleSnake(final int start1, final int end1, final int start2,
++y;
}
// Second step
- if (delta % 2 != 0 && delta - d <= k && k <= delta + d && vUp[i-delta] <= vDown[i]) { // NOPMD
- return buildSnake(vUp[i-delta], k + start1 - start2, end1, end2);
+ if (delta % 2 != 0 && delta - d <= k && k <= delta + d && vUp[i - delta] <= vDown[i]) { // NOPMD
+ return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2);
}
}
@@ -299,17 +299,15 @@ private Snake getMiddleSnake(final int start1, final int end1, final int start2,
for (int k = delta - d; k <= delta + d; k += 2) {
// First step
final int i = k + offset - delta;
- if (k == delta - d
- || k != delta + d && vUp[i+1] <= vUp[i-1]) {
- vUp[i] = vUp[i+1] - 1;
+ if (k == delta - d || k != delta + d && vUp[i + 1] <= vUp[i - 1]) {
+ vUp[i] = vUp[i + 1] - 1;
} else {
- vUp[i] = vUp[i-1];
+ vUp[i] = vUp[i - 1];
}
int x = vUp[i] - 1;
int y = x - start1 + start2 - k;
- while (x >= start1 && y >= start2
- && equator.equate(sequence1.get(x), sequence2.get(y))) {
+ while (x >= start1 && y >= start2 && equator.equate(sequence1.get(x), sequence2.get(y))) {
vUp[i] = x--;
y--;
}
diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
index 5ce903acb1..ec50fa7fff 100644
--- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
@@ -2061,11 +2061,11 @@ public V put(final K key, final V value) {
* Reads the content of the stream.
*/
@SuppressWarnings("unchecked") // This will fail at runtime if the stream is incorrect
- private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException{
+ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
root = new TrieEntry<>(null, null, -1);
final int size = stream.readInt();
- for (int i = 0; i < size; i++){
+ for (int i = 0; i < size; i++) {
final K k = (K) stream.readObject();
final V v = (V) stream.readObject();
put(k, v);
@@ -2434,7 +2434,7 @@ public Collection values() {
/**
* Writes the content to the stream for serialization.
*/
- private void writeObject(final ObjectOutputStream stream) throws IOException{
+ private void writeObject(final ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
stream.writeInt(this.size());
for (final Entry entry : entrySet()) {
diff --git a/src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java b/src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java
index 04477a9543..698a610f34 100644
--- a/src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java
+++ b/src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java
@@ -31,12 +31,10 @@
/**
* Tests base {@link java.util.LinkedList} methods and contracts.
*
- * To use, simply extend this class, and implement
- * the {@link #makeObject()} method.
+ * To use, simply extend this class, and implement the {@link #makeObject()} method.
*
- * If your {@link LinkedList} fails one of these tests by design,
- * you may still use this base set of cases. Simply override the
- * test case (method) your {@link List} fails.
+ * If your {@link LinkedList} fails one of these tests by design, you may still use this base set of cases. Simply override the test case (method) your
+ * {@link List} fails.
*/
public abstract class AbstractLinkedListTest extends AbstractListTest {
@@ -45,9 +43,9 @@ public AbstractLinkedListTest(final String testName) {
}
/**
- * Returns the {@link #collection} field cast to a {@link LinkedList}.
+ * Returns the {@link #collection} field cast to a {@link LinkedList}.
*
- * @return the collection field as a List
+ * @return the collection field as a List
*/
@Override
public LinkedList getCollection() {
@@ -55,16 +53,16 @@ public LinkedList getCollection() {
}
/**
- * Returns the {@link #confirmed} field cast to a {@link LinkedList}.
+ * Returns the {@link #confirmed} field cast to a {@link LinkedList}.
*
- * @return the confirmed field as a List
+ * @return the confirmed field as a List
*/
protected LinkedList getConfirmedLinkedList() {
return (LinkedList) getConfirmed();
}
/**
- * Returns an empty {@link LinkedList}.
+ * Returns an empty {@link LinkedList}.
*/
@Override
public Collection makeConfirmedCollection() {
@@ -72,7 +70,7 @@ public Collection makeConfirmedCollection() {
}
/**
- * Returns a full {@link LinkedList}.
+ * Returns a full {@link LinkedList}.
*/
@Override
public Collection makeConfirmedFullCollection() {
@@ -83,7 +81,7 @@ public Collection makeConfirmedFullCollection() {
public abstract LinkedList makeObject();
/**
- * Tests {@link LinkedList#addFirst(Object)}.
+ * Tests {@link LinkedList#addFirst(Object)}.
*/
@Test
@SuppressWarnings("unchecked")
@@ -105,7 +103,7 @@ public void testLinkedListAddFirst() {
}
/**
- * Tests {@link LinkedList#addLast(Object)}.
+ * Tests {@link LinkedList#addLast(Object)}.
*/
@Test
@SuppressWarnings("unchecked")
@@ -127,43 +125,39 @@ public void testLinkedListAddLast() {
}
/**
- * Tests {@link LinkedList#getFirst()}.
+ * Tests {@link LinkedList#getFirst()}.
*/
@Test
public void testLinkedListGetFirst() {
resetEmpty();
- assertThrows(NoSuchElementException.class, () -> getCollection().getFirst(),
- "getFirst() should throw a NoSuchElementException for an empty list.");
+ assertThrows(NoSuchElementException.class, () -> getCollection().getFirst(), "getFirst() should throw a NoSuchElementException for an empty list.");
verify();
resetFull();
final Object first = getCollection().getFirst();
final Object confirmedFirst = getConfirmedLinkedList().getFirst();
- assertEquals(confirmedFirst, first,
- "Result returned by getFirst() was wrong.");
+ assertEquals(confirmedFirst, first, "Result returned by getFirst() was wrong.");
verify();
}
/**
- * Tests {@link LinkedList#getLast()}.
+ * Tests {@link LinkedList#getLast()}.
*/
@Test
public void testLinkedListGetLast() {
resetEmpty();
- assertThrows(NoSuchElementException.class, () -> getCollection().getLast(),
- "getLast() should throw a NoSuchElementException for an empty list.");
+ assertThrows(NoSuchElementException.class, () -> getCollection().getLast(), "getLast() should throw a NoSuchElementException for an empty list.");
verify();
resetFull();
final Object last = getCollection().getLast();
final Object confirmedLast = getConfirmedLinkedList().getLast();
- assertEquals(confirmedLast, last,
- "Result returned by getLast() was wrong.");
+ assertEquals(confirmedLast, last, "Result returned by getLast() was wrong.");
verify();
}
/**
- * Tests {@link LinkedList#removeFirst()}.
+ * Tests {@link LinkedList#removeFirst()}.
*/
@Test
public void testLinkedListRemoveFirst() {
@@ -179,13 +173,12 @@ public void testLinkedListRemoveFirst() {
resetFull();
final Object first = getCollection().removeFirst();
final Object confirmedFirst = getConfirmedLinkedList().removeFirst();
- assertEquals(confirmedFirst, first,
- "Result returned by removeFirst() was wrong.");
+ assertEquals(confirmedFirst, first, "Result returned by removeFirst() was wrong.");
verify();
}
/**
- * Tests {@link LinkedList#removeLast()}.
+ * Tests {@link LinkedList#removeLast()}.
*/
@Test
public void testLinkedListRemoveLast() {
@@ -194,15 +187,13 @@ public void testLinkedListRemoveLast() {
}
resetEmpty();
- assertThrows(NoSuchElementException.class, () -> getCollection().removeLast(),
- "removeLast() should throw a NoSuchElementException for an empty list.");
+ assertThrows(NoSuchElementException.class, () -> getCollection().removeLast(), "removeLast() should throw a NoSuchElementException for an empty list.");
verify();
resetFull();
final Object last = getCollection().removeLast();
final Object confirmedLast = getConfirmedLinkedList().removeLast();
- assertEquals(confirmedLast, last,
- "Result returned by removeLast() was wrong.");
+ assertEquals(confirmedLast, last, "Result returned by removeLast() was wrong.");
verify();
}
diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
index 497effce68..63fca40229 100644
--- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
@@ -280,12 +280,12 @@ public void forAllButLastDoCollection() {
final Collection strings = Arrays.asList("a", "b", "c");
final StringBuilder result = new StringBuilder();
- result.append(CollectionUtils.forAllButLastDo(strings, (Closure) input -> result.append(input+";")));
+ result.append(CollectionUtils.forAllButLastDo(strings, (Closure) input -> result.append(input + ";")));
assertEquals("a;b;c", result.toString());
final Collection oneString = Arrays.asList("a");
final StringBuilder resultOne = new StringBuilder();
- resultOne.append(CollectionUtils.forAllButLastDo(oneString, (Closure) input -> resultOne.append(input+";")));
+ resultOne.append(CollectionUtils.forAllButLastDo(oneString, (Closure) input -> resultOne.append(input + ";")));
assertEquals("a", resultOne.toString());
assertNull(CollectionUtils.forAllButLastDo(strings, (Closure) null)); // do not remove cast
assertNull(CollectionUtils.forAllButLastDo((Collection) null, (Closure) null)); // do not remove cast
diff --git a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
index 9b8ecb9e2a..676dd231f7 100644
--- a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
@@ -247,7 +247,7 @@ public void testDebugPrintNullKeyToMap2() {
final String INDENT = " ";
final Map