methods and contracts.
| Method from org.apache.commons.collections.set.AbstractTestSortedSet Detail: |
public BulkTest bulkTestSortedSetHeadSet() {
int length = getFullElements().length;
int lobound = length / 3;
int hibound = lobound * 2;
return new TestSortedSetSubSet(hibound, true);
}
|
public BulkTest bulkTestSortedSetSubSet() {
int length = getFullElements().length;
int lobound = length / 3;
int hibound = lobound * 2;
return new TestSortedSetSubSet(lobound, hibound);
}
|
public BulkTest bulkTestSortedSetTailSet() {
int length = getFullElements().length;
int lobound = length / 3;
return new TestSortedSetSubSet(lobound, false);
}
|
public SortedSet getConfirmedSortedSet() {
return (SortedSet) confirmed;
}
|
public Object[] getFullNonNullElements() {
Object[] elements = new Object[30];
for (int i = 0; i < 30; i++) {
elements[i] = new Integer(i + i + 1);
}
return elements;
}
Override to return comparable objects. |
public Object[] getOtherNonNullElements() {
Object[] elements = new Object[30];
for (int i = 0; i < 30; i++) {
elements[i] = new Integer(i + i + 2);
}
return elements;
}
Override to return comparable objects. |
public boolean isNullSupported() {
return false;
}
Overridden because SortedSets don't allow null elements (normally). |
public Collection makeConfirmedCollection() {
return new TreeSet();
}
Returns an empty TreeSet for use in modification testing. |
public void verify() {
super.verify();
// Check that iterator returns elements in order and first() and last()
// are consistent
Iterator colliter = collection.iterator();
Iterator confiter = confirmed.iterator();
Object first = null;
Object last = null;
while (colliter.hasNext()) {
if (first == null) {
first = colliter.next();
last = first;
} else {
last = colliter.next();
}
assertEquals("Element appears to be out of order.", last, confiter.next());
}
if (collection.size() > 0) {
assertEquals("Incorrect element returned by first().", first,
((SortedSet) collection).first());
assertEquals("Incorrect element returned by last().", last,
((SortedSet) collection).last());
}
}
Verification extension, will check the order of elements,
the sets should already be verified equal. |