Skip to content

Commit a01e952

Browse files
committed
Javadoc
1 parent 673adf9 commit a01e952

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,24 @@
5757
* implement the {@link #makeObject()}, {@link #makeConfirmedCollection()}
5858
* and {@link #makeConfirmedFullCollection()} methods.
5959
* You might want to override some of the additional public methods as well:
60+
* </p>
6061
* <p>
6162
* <strong>Element Population Methods</strong>
63+
* </p>
6264
* <p>
6365
* Override these if your collection restricts what kind of elements are
6466
* allowed (for instance, if {@code null} is not permitted):
67+
* </p>
6568
* <ul>
6669
* <li>{@link #getFullElements()}
6770
* <li>{@link #getOtherElements()}
6871
* </ul>
6972
* <p>
7073
* <strong>Supported Operation Methods</strong>
74+
* </p>
7175
* <p>
7276
* Override these if your collection doesn't support certain operations:
77+
* </p>
7378
* <ul>
7479
* <li>{@link #isAddSupported()}
7580
* <li>{@link #isRemoveSupported()}
@@ -79,13 +84,16 @@
7984
* </ul>
8085
* <p>
8186
* <strong>Indicate Collection Behaviour</strong>
87+
* </p>
8288
* <p>
8389
* Override these if your collection makes specific behavior guarantees:
90+
* </p>
8491
* <ul>
8592
* <li>{@link #getIterationBehaviour()}</li>
8693
* </ul>
8794
* <p>
8895
* <strong>Fixture Methods</strong>
96+
* </p>
8997
* <p>
9098
* Fixtures are used to verify that the operation results in correct state
9199
* for the collection. Basically, the operation is performed against your
@@ -99,12 +107,14 @@
99107
* than a simple {@code equals} test. This verification is used to ensure
100108
* proper modifications are made along with ensuring that the collection does
101109
* not change when read-only modifications are made.
110+
* </p>
102111
* <p>
103112
* The {@link #collection} field holds an instance of your collection
104113
* implementation; the {@link #confirmed} field holds an instance of the
105114
* confirmed collection implementation. The {@link #resetEmpty()} and
106115
* {@link #resetFull()} methods set these fields to empty or full collections,
107116
* so that tests can proceed from a known state.
117+
* </p>
108118
* <p>
109119
* After a modification operation to both {@link #collection} and
110120
* {@link #confirmed}, the {@link #verify()} method is invoked to compare
@@ -113,29 +123,35 @@
113123
* views of a map, {@link org.apache.commons.collections4.map.AbstractMapTest AbstractTestMap}
114124
* would override {@link #verify()} to make
115125
* sure the map is changed after the collection view is changed.
126+
* </p>
116127
* <p>
117128
* If you're extending this class directly, you will have to provide
118129
* implementations for the following:
130+
* </p>
119131
* <ul>
120132
* <li>{@link #makeConfirmedCollection()}
121133
* <li>{@link #makeConfirmedFullCollection()}
122134
* </ul>
123135
* <p>
124136
* Those methods should provide a confirmed collection implementation
125137
* that's compatible with your collection implementation.
138+
* </p>
126139
* <p>
127140
* If you're extending {@link org.apache.commons.collections4.list.AbstractListTest AbstractListTest},
128141
* {@link org.apache.commons.collections4.set.AbstractSetTest AbstractTestSet},
129142
* or {@link org.apache.commons.collections4.bag.AbstractBagTest AbstractBagTest},
130143
* you probably don't have to worry about the
131144
* above methods, because those three classes already override the methods
132-
* to provide standard JDK confirmed collections.<P>
145+
* to provide standard JDK confirmed collections.
146+
* </p>
133147
* <p>
134148
* <strong>Other notes</strong>
149+
* </p>
135150
* <p>
136151
* If your {@link Collection} fails one of these tests by design,
137152
* you may still use this base set of cases. Simply override the
138153
* test case (method) your {@link Collection} fails.
154+
* </p>
139155
*/
140156
public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
141157

@@ -261,26 +277,30 @@ private static void assertUnorderedArrayEquals(final Object[] a1, final Object[]
261277

262278
/**
263279
* Specifies whether equal elements in the collection are, in fact,
264-
* distinguishable with information not readily available. That is, if a
265-
* particular value is to be removed from the collection, then there is
280+
* distinguishable with information not readily available.
281+
* <p>
282+
* If a particular value is to be removed from the collection, then there is
266283
* one and only one value that can be removed, even if there are other
267284
* elements which are equal to it.
268-
*
269-
* <P>In most collection cases, elements are not distinguishable (equal is
285+
* </p>
286+
* <p>
287+
* In most collection cases, elements are not distinguishable (equal is
270288
* equal), thus this method defaults to return false. In some cases,
271289
* however, they are. For example, the collection returned from the map's
272290
* values() collection view are backed by the map, so while there may be
273291
* two values that are equal, their associated keys are not. Since the
274292
* keys are distinguishable, the values are.
275-
*
276-
* <P>This flag is used to skip some verifications for iterator.remove()
293+
* </p>
294+
* <p>
295+
* This flag is used to skip some verifications for iterator.remove()
277296
* where it is impossible to perform an equivalent modification on the
278297
* confirmed collection because it is not possible to determine which
279298
* value in the confirmed collection to actually remove. Tests that
280299
* override the default (i.e. where equal elements are distinguishable),
281300
* should provide additional tests on iterator.remove() to make sure the
282301
* proper elements are removed when remove() is called on the iterator.
283-
**/
302+
* </p>
303+
*/
284304
public boolean areEqualElementsDistinguishable() {
285305
return false;
286306
}
@@ -304,13 +324,17 @@ public Collection<E> getConfirmed() {
304324

305325
/**
306326
* Returns an array of objects that are contained in a collection
307-
* produced by {@link #makeFullCollection()}. Every element in the
308-
* returned array <em>must</em> be an element in a full collection.<P>
327+
* produced by {@link #makeFullCollection()}.
328+
* <p>
329+
* Every element in the returned array <em>must</em> be an element in a full collection.
330+
* </p>
331+
* <p>
309332
* The default implementation returns a heterogeneous array of
310333
* objects with some duplicates. null is added if allowed.
311334
* Override if you require specific testing elements. Note that if you
312335
* override {@link #makeFullCollection()}, you <em>must</em> override
313336
* this method to reflect the contents of a full collection.
337+
* <p>
314338
*/
315339
@SuppressWarnings("unchecked")
316340
public E[] getFullElements() {
@@ -429,9 +453,11 @@ public Object[] getOtherNonNullStringElements() {
429453
* Returns true if the collections produced by
430454
* {@link #makeObject()} and {@link #makeFullCollection()}
431455
* support the {@code add} and {@code addAll}
432-
* operations.<P>
456+
* operations.
457+
* <p>
433458
* Default implementation returns true. Override if your collection
434459
* class does not support add or addAll.
460+
* </p>
435461
*/
436462
public boolean isAddSupported() {
437463
return true;

0 commit comments

Comments
 (0)