finish generics (minus one class)

git-svn-id: 
https://svn.apache.org/repos/asf/commons/proper/collections/branches/collections_jdk5_branch@738956
 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/commons-collections/commit/884baf0d
Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/884baf0d
Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/884baf0d

Branch: refs/heads/collections_jdk5_branch
Commit: 884baf0ddc6b869d9d4340b6fc9b1ff4d018e7c2
Parents: b1311a2
Author: Matthew Jason Benson <mben...@apache.org>
Authored: Thu Jan 29 18:48:37 2009 +0000
Committer: Matthew Jason Benson <mben...@apache.org>
Committed: Thu Jan 29 18:48:37 2009 +0000

----------------------------------------------------------------------
 .../apache/commons/collections/ArrayStack.java  |   14 +-
 .../apache/commons/collections/BagUtils.java    |  190 ++-
 .../org/apache/commons/collections/BidiMap.java |    4 +-
 .../commons/collections/BoundedCollection.java  |    2 +-
 .../apache/commons/collections/BoundedMap.java  |    2 +-
 .../collections/BufferOverflowException.java    |    3 +
 .../collections/BufferUnderflowException.java   |    3 +
 .../apache/commons/collections/BufferUtils.java |   27 +-
 .../commons/collections/ClosureUtils.java       |   73 +-
 .../commons/collections/CollectionUtils.java    |   96 +-
 .../commons/collections/ComparatorUtils.java    |   48 +-
 .../commons/collections/EnumerationUtils.java   |   19 +-
 .../commons/collections/FactoryUtils.java       |   14 +-
 .../commons/collections/FunctorException.java   |    7 +-
 .../commons/collections/IteratorUtils.java      |  239 +--
 .../apache/commons/collections/ListUtils.java   |   49 +-
 .../apache/commons/collections/MapUtils.java    |  290 ++--
 .../apache/commons/collections/MultiMap.java    |   12 +-
 .../commons/collections/OrderedBidiMap.java     |   16 +-
 .../apache/commons/collections/OrderedMap.java  |    2 +-
 .../commons/collections/PredicateUtils.java     |  221 ++-
 .../apache/commons/collections/SetUtils.java    |   35 +-
 .../commons/collections/SortedBidiMap.java      |   21 +-
 .../commons/collections/TransformerUtils.java   |  102 +-
 .../collections/bag/AbstractBagDecorator.java   |    3 +
 .../commons/collections/bag/AbstractMapBag.java |  275 ++--
 .../bag/AbstractSortedBagDecorator.java         |    3 +
 .../apache/commons/collections/bag/HashBag.java |   10 +-
 .../collections/bag/SynchronizedBag.java        |    3 +
 .../collections/bag/SynchronizedSortedBag.java  |    4 +-
 .../commons/collections/bag/TransformedBag.java |   25 +-
 .../collections/bag/TransformedSortedBag.java   |   20 +-
 .../apache/commons/collections/bag/TreeBag.java |   60 +-
 .../collections/bag/UnmodifiableBag.java        |   33 +-
 .../collections/bag/UnmodifiableSortedBag.java  |    7 +-
 .../bidimap/AbstractBidiMapDecorator.java       |   29 +-
 .../bidimap/AbstractDualBidiMap.java            |  434 ++---
 .../AbstractOrderedBidiMapDecorator.java        |   39 +-
 .../bidimap/AbstractSortedBidiMapDecorator.java |   38 +-
 .../collections/bidimap/DualHashBidiMap.java    |   22 +-
 .../collections/bidimap/DualTreeBidiMap.java    |  248 +--
 .../collections/bidimap/TreeBidiMap.java        | 1485 +++++++++---------
 .../bidimap/UnmodifiableBidiMap.java            |   54 +-
 .../bidimap/UnmodifiableOrderedBidiMap.java     |   62 +-
 .../bidimap/UnmodifiableSortedBidiMap.java      |   79 +-
 .../buffer/AbstractBufferDecorator.java         |    8 +-
 .../collections/buffer/BoundedBuffer.java       |   26 +-
 .../collections/buffer/BoundedFifoBuffer.java   |   72 +-
 .../collections/buffer/CircularFifoBuffer.java  |   24 +-
 .../collections/buffer/PriorityBuffer.java      |   71 +-
 .../collections/buffer/TransformedBuffer.java   |   16 +-
 .../collections/buffer/UnboundedFifoBuffer.java |   49 +-
 .../collections/buffer/UnmodifiableBuffer.java  |   23 +-
 .../AbstractUntypedCollectionDecorator.java     |  125 ++
 .../collection/CompositeCollection.java         |   55 +-
 .../collection/TransformedCollection.java       |   22 +-
 .../UnmodifiableBoundedCollection.java          |   76 +-
 .../comparators/BooleanComparator.java          |   18 +-
 .../comparators/ComparableComparator.java       |   14 +-
 .../comparators/ComparatorChain.java            |  124 +-
 .../comparators/FixedOrderComparator.java       |  149 +-
 .../collections/comparators/NullComparator.java |   22 +-
 .../comparators/ReverseComparator.java          |   30 +-
 .../comparators/TransformingComparator.java     |   20 +-
 .../collections/functors/AllPredicate.java      |    8 +-
 .../collections/functors/AndPredicate.java      |   35 +-
 .../collections/functors/AnyPredicate.java      |   44 +-
 .../collections/functors/ChainedClosure.java    |   39 +-
 .../functors/ChainedTransformer.java            |   37 +-
 .../collections/functors/CloneTransformer.java  |   11 +-
 .../functors/ClosureTransformer.java            |   14 +-
 .../collections/functors/ConstantFactory.java   |   19 +-
 .../functors/ConstantTransformer.java           |   55 +-
 .../collections/functors/EqualPredicate.java    |    2 +-
 .../collections/functors/ExceptionClosure.java  |   12 +-
 .../collections/functors/ExceptionFactory.java  |   12 +-
 .../functors/ExceptionPredicate.java            |   25 +-
 .../functors/ExceptionTransformer.java          |   22 +-
 .../functors/FactoryTransformer.java            |   14 +-
 .../collections/functors/FalsePredicate.java    |   36 +-
 .../collections/functors/ForClosure.java        |   19 +-
 .../collections/functors/FunctorUtils.java      |   96 +-
 .../collections/functors/IdentityPredicate.java |   33 +-
 .../commons/collections/functors/IfClosure.java |   30 +-
 .../functors/InstanceofPredicate.java           |   26 +-
 .../functors/InstantiateFactory.java            |    7 +-
 .../functors/InstantiateTransformer.java        |   47 +-
 .../functors/InvokerTransformer.java            |   24 +-
 .../collections/functors/MapTransformer.java    |   32 +-
 .../collections/functors/NOPClosure.java        |   26 +-
 .../collections/functors/NOPTransformer.java    |   11 +-
 .../collections/functors/NonePredicate.java     |   38 +-
 .../collections/functors/NotNullPredicate.java  |   11 +-
 .../collections/functors/NotPredicate.java      |   15 +-
 .../functors/NullIsExceptionPredicate.java      |   17 +-
 .../functors/NullIsFalsePredicate.java          |   35 +-
 .../functors/NullIsTruePredicate.java           |   17 +-
 .../collections/functors/OnePredicate.java      |   25 +-
 .../collections/functors/OrPredicate.java       |   35 +-
 .../functors/PredicateTransformer.java          |   18 +-
 .../collections/functors/PrototypeFactory.java  |   40 +-
 .../functors/StringValueTransformer.java        |   11 +-
 .../collections/functors/SwitchClosure.java     |   88 +-
 .../collections/functors/SwitchTransformer.java |   58 +-
 .../functors/TransformedPredicate.java          |   42 +-
 .../functors/TransformerClosure.java            |   16 +-
 .../functors/TransformerPredicate.java          |   41 +-
 .../collections/functors/UniquePredicate.java   |   24 +-
 .../collections/functors/WhileClosure.java      |   18 +-
 .../iterators/AbstractEmptyIterator.java        |   22 +-
 .../iterators/AbstractEmptyMapIterator.java     |   50 +
 .../iterators/AbstractIteratorDecorator.java    |   37 +-
 .../iterators/AbstractMapIteratorDecorator.java |   16 +-
 .../AbstractOrderedMapIteratorDecorator.java    |   18 +-
 .../AbstractUntypedIteratorDecorator.java       |   54 +
 .../collections/iterators/ArrayIterator.java    |    7 +-
 .../iterators/ArrayListIterator.java            |   14 +-
 .../iterators/CollatingIterator.java            |  230 +--
 .../collections/iterators/EmptyIterator.java    |   27 +-
 .../iterators/EmptyListIterator.java            |   41 +-
 .../collections/iterators/EmptyMapIterator.java |   16 +-
 .../iterators/EmptyOrderedIterator.java         |   14 +-
 .../iterators/EmptyOrderedMapIterator.java      |   16 +-
 .../iterators/EntrySetMapIterator.java          |   23 +-
 .../iterators/EnumerationIterator.java          |   20 +-
 .../collections/iterators/FilterIterator.java   |   30 +-
 .../iterators/FilterListIterator.java           |   82 +-
 .../collections/iterators/IteratorChain.java    |  196 +--
 .../iterators/IteratorEnumeration.java          |   66 +-
 .../iterators/ListIteratorWrapper.java          |   18 +-
 .../collections/iterators/LoopingIterator.java  |   10 +-
 .../iterators/LoopingListIterator.java          |   27 +-
 .../iterators/ObjectArrayIterator.java          |   18 +-
 .../iterators/ObjectArrayListIterator.java      |   18 +-
 .../iterators/ObjectGraphIterator.java          |   38 +-
 .../iterators/ReverseListIterator.java          |   20 +-
 .../iterators/SingletonIterator.java            |   12 +-
 .../iterators/SingletonListIterator.java        |   14 +-
 .../iterators/TransformIterator.java            |   31 +-
 .../iterators/UniqueFilterIterator.java         |   16 +-
 .../iterators/UnmodifiableIterator.java         |   14 +-
 .../iterators/UnmodifiableListIterator.java     |   18 +-
 .../iterators/UnmodifiableMapIterator.java      |   20 +-
 .../UnmodifiableOrderedMapIterator.java         |   31 +-
 .../collections/keyvalue/AbstractKeyValue.java  |   12 +-
 .../collections/keyvalue/AbstractMapEntry.java  |    9 +-
 .../keyvalue/AbstractMapEntryDecorator.java     |   14 +-
 .../collections/keyvalue/DefaultKeyValue.java   |   21 +-
 .../collections/keyvalue/DefaultMapEntry.java   |    8 +-
 .../commons/collections/keyvalue/MultiKey.java  |   60 +-
 .../collections/keyvalue/TiedMapEntry.java      |   16 +-
 .../keyvalue/UnmodifiableMapEntry.java          |   10 +-
 .../collections/list/AbstractLinkedList.java    |  331 ++--
 .../collections/list/AbstractListDecorator.java |    8 +-
 .../list/AbstractSerializableListDecorator.java |    9 +-
 .../collections/list/CursorableLinkedList.java  |   99 +-
 .../commons/collections/list/FixedSizeList.java |   46 +-
 .../commons/collections/list/GrowthList.java    |   24 +-
 .../commons/collections/list/LazyList.java      |   41 +-
 .../collections/list/NodeCachingLinkedList.java |   29 +-
 .../commons/collections/list/SetUniqueList.java |  169 +-
 .../collections/list/SynchronizedList.java      |    4 +-
 .../collections/list/TransformedList.java       |   46 +-
 .../commons/collections/list/TreeList.java      |  203 ++-
 .../collections/list/UnmodifiableList.java      |   37 +-
 .../collections/map/AbstractHashedMap.java      |  492 +++---
 .../map/AbstractInputCheckedMapDecorator.java   |   56 +-
 .../collections/map/AbstractLinkedMap.java      |  227 ++-
 .../map/AbstractOrderedMapDecorator.java        |   26 +-
 .../collections/map/AbstractReferenceMap.java   |  427 ++---
 .../map/AbstractSortedMapDecorator.java         |    5 +-
 .../collections/map/CaseInsensitiveMap.java     |   11 +-
 .../commons/collections/map/CompositeMap.java   |  145 +-
 .../commons/collections/map/DefaultedMap.java   |   52 +-
 .../commons/collections/map/FixedSizeMap.java   |   38 +-
 .../collections/map/FixedSizeSortedMap.java     |   61 +-
 .../commons/collections/map/Flat3Map.java       |  314 ++--
 .../commons/collections/map/HashedMap.java      |   28 +-
 .../commons/collections/map/IdentityMap.java    |   58 +-
 .../apache/commons/collections/map/LRUMap.java  |   80 +-
 .../apache/commons/collections/map/LazyMap.java |    4 +-
 .../commons/collections/map/LinkedMap.java      |   83 +-
 .../commons/collections/map/ListOrderedMap.java |  237 ++-
 .../commons/collections/map/MultiKeyMap.java    |  292 ++--
 .../commons/collections/map/MultiValueMap.java  |  134 +-
 .../commons/collections/map/PredicatedMap.java  |   42 +-
 .../collections/map/PredicatedSortedMap.java    |   40 +-
 .../collections/map/ReferenceIdentityMap.java   |   23 +-
 .../commons/collections/map/ReferenceMap.java   |   16 +-
 .../commons/collections/map/SingletonMap.java   |  126 +-
 .../collections/map/StaticBucketMap.java        |  127 +-
 .../commons/collections/map/TransformedMap.java |   50 +-
 .../collections/map/TransformedSortedMap.java   |   52 +-
 .../collections/map/UnmodifiableEntrySet.java   |   56 +-
 .../collections/map/UnmodifiableMap.java        |   42 +-
 .../collections/map/UnmodifiableOrderedMap.java |   41 +-
 .../collections/map/UnmodifiableSortedMap.java  |   57 +-
 .../set/AbstractSerializableSetDecorator.java   |    9 +-
 .../collections/set/AbstractSetDecorator.java   |    8 +-
 .../set/AbstractSortedSetDecorator.java         |    3 +
 .../commons/collections/set/CompositeSet.java   |   93 +-
 .../commons/collections/set/ListOrderedSet.java |  135 +-
 .../commons/collections/set/MapBackedSet.java   |   34 +-
 .../collections/set/SynchronizedSet.java        |    4 +-
 .../collections/set/SynchronizedSortedSet.java  |   30 +-
 .../commons/collections/set/TransformedSet.java |    8 +-
 .../collections/set/TransformedSortedSet.java   |   36 +-
 .../collections/set/UnmodifiableSet.java        |   22 +-
 .../collections/set/UnmodifiableSortedSet.java  |   11 +-
 .../commons/collections/AbstractTestObject.java |    2 +-
 .../apache/commons/collections/BulkTest.java    |   24 +-
 .../commons/collections/LocalTestNode.java      |   30 +-
 .../commons/collections/MapPerformance.java     |   34 +-
 .../commons/collections/MockTestCase.java       |    7 +-
 .../commons/collections/TestArrayList.java      |   29 +-
 .../commons/collections/TestArrayStack.java     |   28 +-
 .../commons/collections/TestBagUtils.java       |   85 +-
 .../commons/collections/TestBufferUtils.java    |    6 +-
 .../commons/collections/TestClosureUtils.java   |  247 +--
 .../collections/TestCollectionUtils.java        |   91 +-
 .../collections/TestEnumerationUtils.java       |   18 +-
 .../commons/collections/TestFactoryUtils.java   |   35 +-
 .../commons/collections/TestIteratorUtils.java  |  179 +--
 .../commons/collections/TestLinkedList.java     |   75 +-
 .../commons/collections/TestListUtils.java      |   79 +-
 .../commons/collections/TestMapUtils.java       |  249 ++-
 .../commons/collections/TestPredicateUtils.java |  435 ++---
 .../commons/collections/TestSetUtils.java       |   43 +-
 .../collections/TestTransformerUtils.java       |  176 ++-
 .../apache/commons/collections/TestTreeMap.java |   30 +-
 .../collections/TestTypedCollection.java        |   23 +-
 .../collections/bag/AbstractTestBag.java        |  307 ++--
 .../collections/bag/AbstractTestSortedBag.java  |   12 +-
 .../commons/collections/bag/TestHashBag.java    |    6 +-
 .../collections/bag/TestPredicatedBag.java      |   75 +-
 .../bag/TestPredicatedSortedBag.java            |   80 +-
 .../collections/bag/TestTransformedBag.java     |   25 +-
 .../bag/TestTransformedSortedBag.java           |   27 +-
 .../commons/collections/bag/TestTreeBag.java    |  109 +-
 .../bidimap/AbstractTestBidiMap.java            |  333 ++--
 .../bidimap/AbstractTestOrderedBidiMap.java     |  104 +-
 .../bidimap/AbstractTestSortedBidiMap.java      |  411 ++---
 .../TestAbstractOrderedBidiMapDecorator.java    |   43 +-
 .../bidimap/TestDualHashBidiMap.java            |   13 +-
 .../bidimap/TestDualTreeBidiMap.java            |   11 +-
 .../bidimap/TestDualTreeBidiMap2.java           |   31 +-
 .../collections/bidimap/TestTreeBidiMap.java    |   11 +-
 .../bidimap/TestUnmodifiableBidiMap.java        |   38 +-
 .../bidimap/TestUnmodifiableOrderedBidiMap.java |   42 +-
 .../bidimap/TestUnmodifiableSortedBidiMap.java  |   44 +-
 .../collections/buffer/TestBlockingBuffer.java  |  406 ++---
 .../collections/buffer/TestBoundedBuffer.java   |  122 +-
 .../buffer/TestBoundedFifoBuffer.java           |   86 +-
 .../buffer/TestBoundedFifoBuffer2.java          |   36 +-
 .../buffer/TestCircularFifoBuffer.java          |  306 ++--
 .../buffer/TestPredicatedBuffer.java            |   70 +-
 .../collections/buffer/TestPriorityBuffer.java  |  214 +--
 .../buffer/TestSynchronizedBuffer.java          |   41 +-
 .../buffer/TestTransformedBuffer.java           |    4 +-
 .../buffer/TestUnboundedFifoBuffer.java         |  200 ++-
 .../buffer/TestUnmodifiableBuffer.java          |   55 +-
 .../collection/AbstractTestCollection.java      |  756 ++++-----
 .../collection/TestCompositeCollection.java     |  279 ++--
 .../collection/TestPredicatedCollection.java    |   85 +-
 .../collection/TestSynchronizedCollection.java  |   33 +-
 .../collection/TestTransformedCollection.java   |    2 +-
 .../collection/TestUnmodifiableCollection.java  |   41 +-
 .../comparators/AbstractTestComparator.java     |   76 +-
 .../comparators/TestBooleanComparator.java      |  112 +-
 .../comparators/TestComparableComparator.java   |   20 +-
 .../comparators/TestComparatorChain.java        |  122 +-
 .../comparators/TestFixedOrderComparator.java   |   86 +-
 .../comparators/TestNullComparator.java         |   66 +-
 .../comparators/TestReverseComparator.java      |   27 +-
 .../collections/functors/TestAllPredicate.java  |   24 +-
 .../functors/TestAnyAllOnePredicate.java        |   29 +-
 .../functors/TestCompositePredicate.java        |   23 +-
 .../iterators/AbstractTestIterator.java         |   21 +-
 .../iterators/AbstractTestListIterator.java     |  111 +-
 .../iterators/AbstractTestMapIterator.java      |  166 +-
 .../AbstractTestOrderedMapIterator.java         |   71 +-
 .../iterators/TestArrayIterator.java            |   24 +-
 .../iterators/TestArrayIterator2.java           |   55 +-
 .../iterators/TestArrayListIterator.java        |   26 +-
 .../iterators/TestArrayListIterator2.java       |   28 +-
 .../iterators/TestCollatingIterator.java        |  120 +-
 .../iterators/TestFilterIterator.java           |   82 +-
 .../iterators/TestFilterListIterator.java       |  362 +++--
 .../iterators/TestIteratorChain.java            |   76 +-
 .../iterators/TestListIteratorWrapper.java      |   72 +-
 .../iterators/TestLoopingIterator.java          |   30 +-
 .../iterators/TestLoopingListIterator.java      |   50 +-
 .../iterators/TestObjectArrayIterator.java      |   48 +-
 .../iterators/TestObjectArrayListIterator.java  |   30 +-
 .../iterators/TestObjectArrayListIterator2.java |   30 +-
 .../iterators/TestObjectGraphIterator.java      |  106 +-
 .../iterators/TestReverseListIterator.java      |   44 +-
 .../iterators/TestSingletonIterator.java        |   50 +-
 .../iterators/TestSingletonIterator2.java       |   18 +-
 .../iterators/TestSingletonListIterator.java    |   15 +-
 .../iterators/TestUniqueFilterIterator.java     |   48 +-
 .../iterators/TestUnmodifiableIterator.java     |   36 +-
 .../iterators/TestUnmodifiableListIterator.java |   38 +-
 .../iterators/TestUnmodifiableMapIterator.java  |   54 +-
 .../TestUnmodifiableOrderedMapIterator.java     |   58 +-
 .../keyvalue/AbstractTestMapEntry.java          |   32 +-
 .../keyvalue/TestDefaultKeyValue.java           |   54 +-
 .../keyvalue/TestDefaultMapEntry.java           |   23 +-
 .../collections/keyvalue/TestMultiKey.java      |  150 +-
 .../collections/keyvalue/TestTiedMapEntry.java  |   42 +-
 .../keyvalue/TestUnmodifiableMapEntry.java      |   34 +-
 .../collections/list/AbstractTestList.java      |  551 +++----
 .../list/TestAbstractLinkedList.java            |  126 +-
 .../list/TestCursorableLinkedList.java          | 1338 ++++++++--------
 .../collections/list/TestFixedSizeList.java     |   18 +-
 .../collections/list/TestGrowthList.java        |   40 +-
 .../list/TestNodeCachingLinkedList.java         |   78 +-
 .../collections/list/TestPredicatedList.java    |  143 +-
 .../collections/list/TestSetUniqueList.java     |  307 ++--
 .../collections/list/TestSynchronizedList.java  |   19 +-
 .../collections/list/TestTransformedList.java   |   69 +-
 .../commons/collections/list/TestTreeList.java  |  112 +-
 .../collections/list/TestUnmodifiableList.java  |   80 +-
 .../map/AbstractTestIterableMap.java            |  110 +-
 .../collections/map/AbstractTestMap.java        |  935 +++++------
 .../collections/map/AbstractTestOrderedMap.java |  142 +-
 .../collections/map/AbstractTestSortedMap.java  |  200 ++-
 .../collections/map/TestCaseInsensitiveMap.java |   79 +-
 .../collections/map/TestCompositeMap.java       |  127 +-
 .../collections/map/TestDefaultedMap.java       |   68 +-
 .../collections/map/TestFixedSizeMap.java       |   18 +-
 .../collections/map/TestFixedSizeSortedMap.java |   21 +-
 .../commons/collections/map/TestFlat3Map.java   |  243 +--
 .../commons/collections/map/TestHashedMap.java  |   29 +-
 .../collections/map/TestIdentityMap.java        |   76 +-
 .../commons/collections/map/TestLRUMap.java     |  335 ++--
 .../commons/collections/map/TestLazyMap.java    |   30 +-
 .../collections/map/TestLazySortedMap.java      |    8 +-
 .../commons/collections/map/TestLinkedMap.java  |  181 ++-
 .../collections/map/TestListOrderedMap.java     |  232 +--
 .../collections/map/TestListOrderedMap2.java    |   96 +-
 .../collections/map/TestMultiKeyMap.java        |  189 +--
 .../collections/map/TestMultiValueMap.java      |  240 +--
 .../collections/map/TestPredicatedMap.java      |   88 +-
 .../map/TestPredicatedSortedMap.java            |  122 +-
 .../map/TestReferenceIdentityMap.java           |  126 +-
 .../collections/map/TestReferenceMap.java       |   62 +-
 .../collections/map/TestSingletonMap.java       |   66 +-
 .../collections/map/TestStaticBucketMap.java    |   31 +-
 .../collections/map/TestTransformedMap.java     |   75 +-
 .../map/TestTransformedSortedMap.java           |   95 +-
 .../collections/map/TestUnmodifiableMap.java    |   49 +-
 .../map/TestUnmodifiableOrderedMap.java         |   49 +-
 .../map/TestUnmodifiableSortedMap.java          |   49 +-
 .../collections/set/AbstractTestSet.java        |   73 +-
 .../collections/set/AbstractTestSortedSet.java  |  106 +-
 .../collections/set/TestCompositeSet.java       |  156 +-
 .../collections/set/TestListOrderedSet.java     |  103 +-
 .../collections/set/TestListOrderedSet2.java    |   92 +-
 .../collections/set/TestMapBackedSet.java       |    6 +-
 .../collections/set/TestMapBackedSet2.java      |   26 +-
 .../collections/set/TestPredicatedSet.java      |  110 +-
 .../set/TestPredicatedSortedSet.java            |  107 +-
 .../collections/set/TestSynchronizedSet.java    |   24 +-
 .../set/TestSynchronizedSortedSet.java          |   26 +-
 .../collections/set/TestTransformedSet.java     |   48 +-
 .../set/TestTransformedSortedSet.java           |   40 +-
 .../collections/set/TestUnmodifiableSet.java    |   34 +-
 .../set/TestUnmodifiableSortedSet.java          |   77 +-
 369 files changed, 15616 insertions(+), 14602 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/ArrayStack.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/ArrayStack.java 
b/src/java/org/apache/commons/collections/ArrayStack.java
index 530d764..891fc70 100644
--- a/src/java/org/apache/commons/collections/ArrayStack.java
+++ b/src/java/org/apache/commons/collections/ArrayStack.java
@@ -42,7 +42,7 @@ import java.util.EmptyStackException;
  * @author Paul Jack
  * @author Stephen Colebourne
  */
-public class ArrayStack extends ArrayList implements Buffer {
+public class ArrayStack<E> extends ArrayList<E> implements Buffer<E> {
 
     /** Ensure serialization compatibility */    
     private static final long serialVersionUID = 2130079159931574599L;
@@ -84,7 +84,7 @@ public class ArrayStack extends ArrayList implements Buffer {
      * @return the top item on the stack
      * @throws EmptyStackException  if the stack is empty
      */
-    public Object peek() throws EmptyStackException {
+    public E peek() throws EmptyStackException {
         int n = size();
         if (n <= 0) {
             throw new EmptyStackException();
@@ -102,7 +102,7 @@ public class ArrayStack extends ArrayList implements Buffer 
{
      * @throws EmptyStackException  if there are not enough items on the
      *  stack to satisfy this request
      */
-    public Object peek(int n) throws EmptyStackException {
+    public E peek(int n) throws EmptyStackException {
         int m = (size() - n) - 1;
         if (m < 0) {
             throw new EmptyStackException();
@@ -117,7 +117,7 @@ public class ArrayStack extends ArrayList implements Buffer 
{
      * @return the top item on the stack
      * @throws EmptyStackException  if the stack is empty
      */
-    public Object pop() throws EmptyStackException {
+    public E pop() throws EmptyStackException {
         int n = size();
         if (n <= 0) {
             throw new EmptyStackException();
@@ -133,7 +133,7 @@ public class ArrayStack extends ArrayList implements Buffer 
{
      * @param item  the item to be added
      * @return the item just pushed
      */
-    public Object push(Object item) {
+    public E push(E item) {
         add(item);
         return item;
     }
@@ -170,7 +170,7 @@ public class ArrayStack extends ArrayList implements Buffer 
{
      * @return the element on the top of the stack
      * @throws BufferUnderflowException  if the stack is empty
      */
-    public Object get() {
+    public E get() {
         int size = size();
         if (size == 0) {
             throw new BufferUnderflowException();
@@ -184,7 +184,7 @@ public class ArrayStack extends ArrayList implements Buffer 
{
      * @return the removed element 
      * @throws BufferUnderflowException  if the stack is empty
      */
-    public Object remove() {
+    public E remove() {
         int size = size();
         if (size == 0) {
             throw new BufferUnderflowException();

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BagUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/BagUtils.java 
b/src/java/org/apache/commons/collections/BagUtils.java
index 86e471d..af3b02e 100644
--- a/src/java/org/apache/commons/collections/BagUtils.java
+++ b/src/java/org/apache/commons/collections/BagUtils.java
@@ -28,11 +28,12 @@ import org.apache.commons.collections.bag.UnmodifiableBag;
 import org.apache.commons.collections.bag.UnmodifiableSortedBag;
 
 /**
- * Provides utility methods and decorators for
- * {@link Bag} and {@link SortedBag} instances.
- *
+ * Provides utility methods and decorators for {@link Bag} and {@link 
SortedBag}
+ * instances.
+ * 
  * @since Commons Collections 2.1
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-07-13 05:39:24 -0500 (Fri, 13 Jul
+ * 2007) $
  * 
  * @author Paul Jack
  * @author Stephen Colebourne
@@ -44,29 +45,29 @@ public class BagUtils {
     /**
      * An empty unmodifiable bag.
      */
-    public static final Bag EMPTY_BAG = UnmodifiableBag.decorate(new 
HashBag());
+    public static final Bag<Object> EMPTY_BAG = UnmodifiableBag.decorate(new 
HashBag<Object>());
 
     /**
      * An empty unmodifiable sorted bag.
      */
-    public static final Bag EMPTY_SORTED_BAG = 
UnmodifiableSortedBag.decorate(new TreeBag());
+    public static final Bag<Object> EMPTY_SORTED_BAG = 
UnmodifiableSortedBag.decorate(new TreeBag<Object>());
 
     /**
-     * Instantiation of BagUtils is not intended or required.
-     * However, some tools require an instance to operate.
+     * Instantiation of BagUtils is not intended or required. However, some
+     * tools require an instance to operate.
      */
     public BagUtils() {
     }
 
     //-----------------------------------------------------------------------
     /**
-     * Returns a synchronized (thread-safe) bag backed by the given bag.
-     * In order to guarantee serial access, it is critical that all 
-     * access to the backing bag is accomplished through the returned bag.
+     * Returns a synchronized (thread-safe) bag backed by the given bag. In
+     * order to guarantee serial access, it is critical that all access to the
+     * backing bag is accomplished through the returned bag.
      * <p>
-     * It is imperative that the user manually synchronize on the returned
-     * bag when iterating over it:
-     *
+     * It is imperative that the user manually synchronize on the returned bag
+     * when iterating over it:
+     * 
      * <pre>
      * Bag bag = BagUtils.synchronizedBag(new HashBag());
      * ...
@@ -77,74 +78,73 @@ public class BagUtils {
      *     }
      * }
      * </pre>
-     *
-     * Failure to follow this advice may result in non-deterministic 
-     * behavior.
-     *
-     * @param bag  the bag to synchronize, must not be null
+     * 
+     * Failure to follow this advice may result in non-deterministic behavior.
+     * 
+     * @param bag the bag to synchronize, must not be null
      * @return a synchronized bag backed by that bag
-     * @throws IllegalArgumentException  if the Bag is null
+     * @throws IllegalArgumentException if the Bag is null
      */
     public static <E> Bag<E> synchronizedBag(Bag<E> bag) {
         return SynchronizedBag.decorate(bag);
     }
 
     /**
-     * Returns an unmodifiable view of the given bag.  Any modification
-     * attempts to the returned bag will raise an 
-     * {@link UnsupportedOperationException}.
-     *
-     * @param bag  the bag whose unmodifiable view is to be returned, must not 
be null
+     * Returns an unmodifiable view of the given bag. Any modification attempts
+     * to the returned bag will raise an {@link UnsupportedOperationException}.
+     * 
+     * @param bag the bag whose unmodifiable view is to be returned, must not 
be
+     * null
      * @return an unmodifiable view of that bag
-     * @throws IllegalArgumentException  if the Bag is null
+     * @throws IllegalArgumentException if the Bag is null
      */
     public static <E> Bag<E> unmodifiableBag(Bag<E> bag) {
         return UnmodifiableBag.decorate(bag);
     }
-    
+
     /**
      * Returns a predicated (validating) bag backed by the given bag.
      * <p>
-     * Only objects that pass the test in the given predicate can be added to 
the bag.
-     * Trying to add an invalid object results in an IllegalArgumentException.
-     * It is important not to use the original bag after invoking this method,
-     * as it is a backdoor for adding invalid objects.
-     *
-     * @param bag  the bag to predicate, must not be null
-     * @param predicate  the predicate for the bag, must not be null
+     * Only objects that pass the test in the given predicate can be added to
+     * the bag. Trying to add an invalid object results in an
+     * IllegalArgumentException. It is important not to use the original bag
+     * after invoking this method, as it is a backdoor for adding invalid
+     * objects.
+     * 
+     * @param bag the bag to predicate, must not be null
+     * @param predicate the predicate for the bag, must not be null
      * @return a predicated bag backed by the given bag
-     * @throws IllegalArgumentException  if the Bag or Predicate is null
+     * @throws IllegalArgumentException if the Bag or Predicate is null
      */
     public static <E> Bag<E> predicatedBag(Bag<E> bag, Predicate<? super E> 
predicate) {
         return PredicatedBag.decorate(bag, predicate);
     }
-    
+
     /**
      * Returns a transformed bag backed by the given bag.
      * <p>
-     * Each object is passed through the transformer as it is added to the
-     * Bag. It is important not to use the original bag after invoking this 
-     * method, as it is a backdoor for adding untransformed objects.
-     *
-     * @param bag  the bag to predicate, must not be null
-     * @param transformer  the transformer for the bag, must not be null
+     * Each object is passed through the transformer as it is added to the Bag.
+     * It is important not to use the original bag after invoking this method,
+     * as it is a backdoor for adding untransformed objects.
+     * 
+     * @param bag the bag to predicate, must not be null
+     * @param transformer the transformer for the bag, must not be null
      * @return a transformed bag backed by the given bag
-     * @throws IllegalArgumentException  if the Bag or Transformer is null
+     * @throws IllegalArgumentException if the Bag or Transformer is null
      */
-    public static Bag transformedBag(Bag bag, Transformer transformer) {
+    public static <E> Bag<E> transformedBag(Bag<E> bag, Transformer<? super E, 
? extends E> transformer) {
         return TransformedBag.decorate(bag, transformer);
     }
-    
+
     //-----------------------------------------------------------------------
     /**
-     * Returns a synchronized (thread-safe) sorted bag backed by the given 
-     * sorted bag.
-     * In order to guarantee serial access, it is critical that all 
+     * Returns a synchronized (thread-safe) sorted bag backed by the given
+     * sorted bag. In order to guarantee serial access, it is critical that all
      * access to the backing bag is accomplished through the returned bag.
      * <p>
-     * It is imperative that the user manually synchronize on the returned
-     * bag when iterating over it:
-     *
+     * It is imperative that the user manually synchronize on the returned bag
+     * when iterating over it:
+     * 
      * <pre>
      * SortedBag bag = BagUtils.synchronizedSortedBag(new TreeBag());
      * ...
@@ -155,62 +155,84 @@ public class BagUtils {
      *     }
      * }
      * </pre>
-     *
-     * Failure to follow this advice may result in non-deterministic 
-     * behavior.
-     *
-     * @param bag  the bag to synchronize, must not be null
+     * 
+     * Failure to follow this advice may result in non-deterministic behavior.
+     * 
+     * @param bag the bag to synchronize, must not be null
      * @return a synchronized bag backed by that bag
-     * @throws IllegalArgumentException  if the SortedBag is null
+     * @throws IllegalArgumentException if the SortedBag is null
      */
     public static <E> SortedBag<E> synchronizedSortedBag(SortedBag<E> bag) {
         return SynchronizedSortedBag.decorate(bag);
     }
-    
+
     /**
-     * Returns an unmodifiable view of the given sorted bag.  Any modification
-     * attempts to the returned bag will raise an 
+     * Returns an unmodifiable view of the given sorted bag. Any modification
+     * attempts to the returned bag will raise an
      * {@link UnsupportedOperationException}.
-     *
-     * @param bag  the bag whose unmodifiable view is to be returned, must not 
be null
+     * 
+     * @param bag the bag whose unmodifiable view is to be returned, must not 
be
+     * null
      * @return an unmodifiable view of that bag
-     * @throws IllegalArgumentException  if the SortedBag is null
+     * @throws IllegalArgumentException if the SortedBag is null
      */
     public static <E> SortedBag<E> unmodifiableSortedBag(SortedBag<E> bag) {
         return UnmodifiableSortedBag.decorate(bag);
     }
-    
+
     /**
-     * Returns a predicated (validating) sorted bag backed by the given sorted 
bag.
+     * Returns a predicated (validating) sorted bag backed by the given sorted
+     * bag.
      * <p>
-     * Only objects that pass the test in the given predicate can be added to 
the bag.
-     * Trying to add an invalid object results in an IllegalArgumentException.
-     * It is important not to use the original bag after invoking this method,
-     * as it is a backdoor for adding invalid objects.
-     *
-     * @param bag  the sorted bag to predicate, must not be null
-     * @param predicate  the predicate for the bag, must not be null
+     * Only objects that pass the test in the given predicate can be added to
+     * the bag. Trying to add an invalid object results in an
+     * IllegalArgumentException. It is important not to use the original bag
+     * after invoking this method, as it is a backdoor for adding invalid
+     * objects.
+     * 
+     * @param bag the sorted bag to predicate, must not be null
+     * @param predicate the predicate for the bag, must not be null
      * @return a predicated bag backed by the given bag
-     * @throws IllegalArgumentException  if the SortedBag or Predicate is null
+     * @throws IllegalArgumentException if the SortedBag or Predicate is null
      */
-    public static <E> SortedBag<E> predicatedSortedBag(SortedBag<E> bag, 
Predicate<? super E> predicate) {
+    public static <E> SortedBag<E> predicatedSortedBag(SortedBag<E> bag,
+            Predicate<? super E> predicate) {
         return PredicatedSortedBag.decorate(bag, predicate);
     }
-    
+
     /**
      * Returns a transformed sorted bag backed by the given bag.
      * <p>
-     * Each object is passed through the transformer as it is added to the
-     * Bag. It is important not to use the original bag after invoking this 
-     * method, as it is a backdoor for adding untransformed objects.
-     *
-     * @param bag  the bag to predicate, must not be null
-     * @param transformer  the transformer for the bag, must not be null
+     * Each object is passed through the transformer as it is added to the Bag.
+     * It is important not to use the original bag after invoking this method,
+     * as it is a backdoor for adding untransformed objects.
+     * 
+     * @param bag the bag to predicate, must not be null
+     * @param transformer the transformer for the bag, must not be null
      * @return a transformed bag backed by the given bag
-     * @throws IllegalArgumentException  if the Bag or Transformer is null
+     * @throws IllegalArgumentException if the Bag or Transformer is null
      */
-    public static SortedBag transformedSortedBag(SortedBag bag, Transformer 
transformer) {
+    public static <E> SortedBag<E> transformedSortedBag(SortedBag<E> bag, 
Transformer<? super E, ? extends E> transformer) {
         return TransformedSortedBag.decorate(bag, transformer);
     }
-    
+
+    /**
+     * Get an empty <code>Bag</code>.
+     * @param <E>
+     * @return Bag<E>
+     */
+    @SuppressWarnings("unchecked")
+    public static <E> Bag<E> emptyBag() {
+        return (Bag<E>) EMPTY_BAG;        
+    }
+
+    /**
+     * Get an empty <code>SortedBag</code>.
+     * @param <E>
+     * @return SortedBag<E>
+     */
+    @SuppressWarnings("unchecked")
+    public static <E> SortedBag<E> emptySortedBag() {
+        return (SortedBag<E>) EMPTY_SORTED_BAG;        
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BidiMap.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/BidiMap.java 
b/src/java/org/apache/commons/collections/BidiMap.java
index 125f6d7..860b81c 100644
--- a/src/java/org/apache/commons/collections/BidiMap.java
+++ b/src/java/org/apache/commons/collections/BidiMap.java
@@ -88,7 +88,7 @@ public interface BidiMap<K, V> extends IterableMap<K, V> {
      * @throws NullPointerException (optional) if the map limits the values to
      *  non-null and null was specified
      */
-    K getKey(V value);
+    K getKey(Object value);
 
     /**
      * Removes the key-value pair that is currently mapped to the specified
@@ -109,7 +109,7 @@ public interface BidiMap<K, V> extends IterableMap<K, V> {
      * @throws UnsupportedOperationException if this method is not supported
      *  by the implementation
      */
-    K removeValue(V value);
+    K removeValue(Object value);
 
     /**
      * Gets a view of this map where the keys and values are reversed.

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BoundedCollection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/BoundedCollection.java 
b/src/java/org/apache/commons/collections/BoundedCollection.java
index d5a54b5..1eb78a3 100644
--- a/src/java/org/apache/commons/collections/BoundedCollection.java
+++ b/src/java/org/apache/commons/collections/BoundedCollection.java
@@ -34,7 +34,7 @@ import java.util.Collection;
  * @author Herve Quiroz
  * @author Stephen Colebourne
  */
-public interface BoundedCollection extends Collection {
+public interface BoundedCollection<E> extends Collection<E> {
 
     /**
      * Returns true if this collection is full and no new elements can be 
added.

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BoundedMap.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/BoundedMap.java 
b/src/java/org/apache/commons/collections/BoundedMap.java
index 525fe2f..0a8123f 100644
--- a/src/java/org/apache/commons/collections/BoundedMap.java
+++ b/src/java/org/apache/commons/collections/BoundedMap.java
@@ -30,7 +30,7 @@ import java.util.Map;
  * 
  * @author Stephen Colebourne
  */
-public interface BoundedMap extends Map {
+public interface BoundedMap<K, V> extends Map<K, V> {
 
     /**
      * Returns true if this map is full and no new elements can be added.

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BufferOverflowException.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/commons/collections/BufferOverflowException.java 
b/src/java/org/apache/commons/collections/BufferOverflowException.java
index b4cc029..024f1b5 100644
--- a/src/java/org/apache/commons/collections/BufferOverflowException.java
+++ b/src/java/org/apache/commons/collections/BufferOverflowException.java
@@ -31,6 +31,9 @@ package org.apache.commons.collections;
  */
 public class BufferOverflowException extends RuntimeException {
     
+    /** Serialization version */
+    private static final long serialVersionUID = -3992254982265755876L;
+
     /** The root cause throwable */
     private final Throwable throwable;
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BufferUnderflowException.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/commons/collections/BufferUnderflowException.java 
b/src/java/org/apache/commons/collections/BufferUnderflowException.java
index fbb52b7..79cb94e 100644
--- a/src/java/org/apache/commons/collections/BufferUnderflowException.java
+++ b/src/java/org/apache/commons/collections/BufferUnderflowException.java
@@ -34,6 +34,9 @@ import java.util.NoSuchElementException;
  */
 public class BufferUnderflowException extends NoSuchElementException {
     
+    /** Serialization version */
+    private static final long serialVersionUID = 4054570024234606028L;
+
     /** The root cause throwable */
     private final Throwable throwable;
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/BufferUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/BufferUtils.java 
b/src/java/org/apache/commons/collections/BufferUtils.java
index 6257434..0e09fe8 100644
--- a/src/java/org/apache/commons/collections/BufferUtils.java
+++ b/src/java/org/apache/commons/collections/BufferUtils.java
@@ -37,7 +37,7 @@ public class BufferUtils {
     /**
      * An empty unmodifiable buffer.
      */
-    public static final Buffer EMPTY_BUFFER = UnmodifiableBuffer.decorate(new 
ArrayStack(1));
+    public static final Buffer<Object> EMPTY_BUFFER = 
UnmodifiableBuffer.decorate(new ArrayStack<Object>(1));
 
     /**
      * <code>BufferUtils</code> should not normally be instantiated.
@@ -66,7 +66,7 @@ public class BufferUtils {
      * @return a synchronized buffer backed by that buffer
      * @throws IllegalArgumentException  if the Buffer is null
      */
-    public static Buffer synchronizedBuffer(Buffer buffer) {
+    public static <E> Buffer<E> synchronizedBuffer(Buffer<E> buffer) {
         return SynchronizedBuffer.decorate(buffer);
     }
 
@@ -82,7 +82,7 @@ public class BufferUtils {
      * @return a blocking buffer backed by that buffer
      * @throws IllegalArgumentException  if the Buffer is null
      */
-    public static Buffer blockingBuffer(Buffer buffer) {
+    public static <E> Buffer<E> blockingBuffer(Buffer<E> buffer) {
         return BlockingBuffer.decorate(buffer);
     }
 
@@ -100,7 +100,7 @@ public class BufferUtils {
      * @throws IllegalArgumentException  if the Buffer is null
      * @since Commons Collections 3.2
      */
-    public static Buffer blockingBuffer(Buffer buffer, long timeoutMillis) {
+    public static <E> Buffer<E> blockingBuffer(Buffer<E> buffer, long 
timeoutMillis) {
         return BlockingBuffer.decorate(buffer, timeoutMillis);
     }
 
@@ -117,7 +117,7 @@ public class BufferUtils {
      * @throws IllegalArgumentException if the given buffer is null
      * @since Commons Collections 3.2
      */
-    public static Buffer boundedBuffer(Buffer buffer, int maximumSize) {
+    public static <E> Buffer<E> boundedBuffer(Buffer<E> buffer, int 
maximumSize) {
         return BoundedBuffer.decorate(buffer, maximumSize);
     }
 
@@ -135,7 +135,7 @@ public class BufferUtils {
      * @throws IllegalArgumentException if the given buffer is null
      * @since Commons Collections 3.2
      */
-    public static Buffer boundedBuffer(Buffer buffer, int maximumSize, long 
timeoutMillis) {
+    public static <E> Buffer<E> boundedBuffer(Buffer<E> buffer, int 
maximumSize, long timeoutMillis) {
         return BoundedBuffer.decorate(buffer, maximumSize, timeoutMillis);
     }
 
@@ -146,7 +146,7 @@ public class BufferUtils {
      * @return an unmodifiable buffer backed by that buffer
      * @throws IllegalArgumentException  if the Buffer is null
      */
-    public static Buffer unmodifiableBuffer(Buffer buffer) {
+    public static <E> Buffer<E> unmodifiableBuffer(Buffer<E> buffer) {
         return UnmodifiableBuffer.decorate(buffer);
     }
 
@@ -163,7 +163,7 @@ public class BufferUtils {
      * @return a predicated buffer
      * @throws IllegalArgumentException  if the Buffer or Predicate is null
      */
-    public static Buffer predicatedBuffer(Buffer buffer, Predicate predicate) {
+    public static <E> Buffer<E> predicatedBuffer(Buffer<E> buffer, Predicate<? 
super E> predicate) {
         return PredicatedBuffer.decorate(buffer, predicate);
     }
 
@@ -179,8 +179,17 @@ public class BufferUtils {
      * @return a transformed buffer backed by the given buffer
      * @throws IllegalArgumentException  if the Buffer or Transformer is null
      */
-    public static Buffer transformedBuffer(Buffer buffer, Transformer 
transformer) {
+    public static <E> Buffer<E> transformedBuffer(Buffer<E> buffer, 
Transformer<? super E, ? extends E> transformer) {
         return TransformedBuffer.decorate(buffer, transformer);
     }
 
+    /**
+     * Get an empty <code>Buffer</code>.
+     * @param <E>
+     * @return Buffer<E>
+     */
+    @SuppressWarnings("unchecked")
+    public static <E> Buffer<E> emptyBuffer() {
+        return (Buffer<E>) EMPTY_BUFFER;
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/ClosureUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/ClosureUtils.java 
b/src/java/org/apache/commons/collections/ClosureUtils.java
index ff0270d..750c284 100644
--- a/src/java/org/apache/commons/collections/ClosureUtils.java
+++ b/src/java/org/apache/commons/collections/ClosureUtils.java
@@ -17,7 +17,6 @@
 package org.apache.commons.collections;
 
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.commons.collections.functors.ChainedClosure;
@@ -71,8 +70,8 @@ public class ClosureUtils {
      * 
      * @return the closure
      */
-    public static Closure exceptionClosure() {
-        return ExceptionClosure.INSTANCE;
+    public static <E> Closure<E> exceptionClosure() {
+        return ExceptionClosure.<E>getInstance();
     }
 
     /**
@@ -83,8 +82,8 @@ public class ClosureUtils {
      * 
      * @return the closure
      */
-    public static Closure nopClosure() {
-        return NOPClosure.INSTANCE;
+    public static <E> Closure<E> nopClosure() {
+        return NOPClosure.<E>getInstance();
     }
 
     /**
@@ -97,7 +96,7 @@ public class ClosureUtils {
      * @param transformer  the transformer to run each time in the closure, 
null means nop
      * @return the closure
      */
-    public static Closure asClosure(Transformer transformer) {
+    public static <E> Closure<E> asClosure(Transformer<? super E, ?> 
transformer) {
         return TransformerClosure.getInstance(transformer);
     }
 
@@ -112,7 +111,7 @@ public class ClosureUtils {
      * @param closure  the closure to call repeatedly
      * @return the <code>for</code> closure
      */
-    public static Closure forClosure(int count, Closure closure) {
+    public static <E> Closure<E> forClosure(int count, Closure<? super E> 
closure) {
         return ForClosure.getInstance(count, closure);
     }
 
@@ -127,8 +126,8 @@ public class ClosureUtils {
      * @return the <code>while</code> closure
      * @throws IllegalArgumentException if either argument is null
      */
-    public static Closure whileClosure(Predicate predicate, Closure closure) {
-        return WhileClosure.getInstance(predicate, closure, false);
+    public static <E> Closure<E> whileClosure(Predicate<? super E> predicate, 
Closure<? super E> closure) {
+        return WhileClosure.<E>getInstance(predicate, closure, false);
     }
 
     /**
@@ -142,8 +141,8 @@ public class ClosureUtils {
      * @return the <code>do-while</code> closure
      * @throws IllegalArgumentException if either argument is null
      */
-    public static Closure doWhileClosure(Closure closure, Predicate predicate) 
{
-        return WhileClosure.getInstance(predicate, closure, true);
+    public static <E> Closure<E> doWhileClosure(Closure<? super E> closure, 
Predicate<? super E> predicate) {
+        return WhileClosure.<E>getInstance(predicate, closure, true);
     }
 
     /**
@@ -157,9 +156,9 @@ public class ClosureUtils {
      * @return the <code>invoker</code> closure
      * @throws IllegalArgumentException if the method name is null
      */
-    public static Closure invokerClosure(String methodName) {
+    public static <E> Closure<E> invokerClosure(String methodName) {
         // reuse transformer as it has caching - this is lazy really, should 
have inner class here
-        return asClosure(InvokerTransformer.getInstance(methodName));
+        return asClosure(InvokerTransformer.<E, 
Object>getInstance(methodName));
     }
 
     /**
@@ -176,9 +175,9 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the method name is null
      * @throws IllegalArgumentException if the paramTypes and args don't match
      */
-    public static Closure invokerClosure(String methodName, Class[] 
paramTypes, Object[] args) {
+    public static <E> Closure<E> invokerClosure(String methodName, Class<?>[] 
paramTypes, Object[] args) {
         // reuse transformer as it has caching - this is lazy really, should 
have inner class here
-        return asClosure(InvokerTransformer.getInstance(methodName, 
paramTypes, args));
+        return asClosure(InvokerTransformer.<E, Object>getInstance(methodName, 
paramTypes, args));
     }
 
     /**
@@ -192,8 +191,8 @@ public class ClosureUtils {
      * @return the <code>chained</code> closure
      * @throws IllegalArgumentException if either closure is null
      */
-    public static Closure chainedClosure(Closure closure1, Closure closure2) {
-        return ChainedClosure.getInstance(closure1, closure2);
+    public static <E> Closure<E> chainedClosure(Closure<? super E> closure1, 
Closure<? super E> closure2) {
+        return ChainedClosure.<E>getInstance(closure1, closure2);
     }
 
     /**
@@ -207,7 +206,7 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the closures array is null
      * @throws IllegalArgumentException if any closure in the array is null
      */
-    public static Closure chainedClosure(Closure[] closures) {
+    public static <E> Closure<E> chainedClosure(Closure<? super E>[] closures) 
{
         return ChainedClosure.getInstance(closures);
     }
 
@@ -224,7 +223,7 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the closures collection is empty
      * @throws IllegalArgumentException if any closure in the collection is 
null
      */
-    public static Closure chainedClosure(Collection closures) {
+    public static <E> Closure<E> chainedClosure(Collection<Closure<E>> 
closures) {
         return ChainedClosure.getInstance(closures);
     }
 
@@ -241,8 +240,8 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the closure is null
      * @since Commons Collections 3.2
      */
-    public static Closure ifClosure(Predicate predicate, Closure trueClosure) {
-        return IfClosure.getInstance(predicate, trueClosure);
+    public static <E> Closure<E> ifClosure(Predicate<? super E> predicate, 
Closure<? super E> trueClosure) {
+        return IfClosure.<E>getInstance(predicate, trueClosure);
     }
 
     /**
@@ -258,8 +257,8 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the predicate is null
      * @throws IllegalArgumentException if either closure is null
      */
-    public static Closure ifClosure(Predicate predicate, Closure trueClosure, 
Closure falseClosure) {
-        return IfClosure.getInstance(predicate, trueClosure, falseClosure);
+    public static <E> Closure<E> ifClosure(Predicate<? super E> predicate, 
Closure<? super E> trueClosure, Closure<? super E> falseClosure) {
+        return IfClosure.<E>getInstance(predicate, trueClosure, falseClosure);
     }
 
     /**
@@ -279,8 +278,8 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if any element in the arrays is null
      * @throws IllegalArgumentException if the arrays are different sizes
      */
-    public static Closure switchClosure(Predicate[] predicates, Closure[] 
closures) {
-        return SwitchClosure.getInstance(predicates, closures, null);
+    public static <E> Closure<E> switchClosure(Predicate<? super E>[] 
predicates, Closure<? super E>[] closures) {
+        return SwitchClosure.<E>getInstance(predicates, closures, null);
     }
 
     /**
@@ -302,8 +301,8 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if any element in the arrays is null
      * @throws IllegalArgumentException if the arrays are different sizes
      */
-    public static Closure switchClosure(Predicate[] predicates, Closure[] 
closures, Closure defaultClosure) {
-        return SwitchClosure.getInstance(predicates, closures, defaultClosure);
+    public static <E> Closure<E> switchClosure(Predicate<? super E>[] 
predicates, Closure<? super E>[] closures, Closure<? super E> defaultClosure) {
+        return SwitchClosure.<E>getInstance(predicates, closures, 
defaultClosure);
     }
     
     /**
@@ -326,7 +325,7 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if any closure in the map is null
      * @throws ClassCastException  if the map elements are of the wrong type
      */
-    public static Closure switchClosure(Map predicatesAndClosures) {
+    public static <E> Closure<E> switchClosure(Map<Predicate<E>, Closure<E>> 
predicatesAndClosures) {
         return SwitchClosure.getInstance(predicatesAndClosures);
     }
 
@@ -347,24 +346,24 @@ public class ClosureUtils {
      * @throws IllegalArgumentException if the map is empty
      * @throws IllegalArgumentException if any closure in the map is null
      */
-    public static Closure switchMapClosure(Map objectsAndClosures) {
-        Closure[] trs = null;
-        Predicate[] preds = null;
+    @SuppressWarnings("unchecked")
+    public static <E> Closure<E> switchMapClosure(Map<? extends E, Closure<E>> 
objectsAndClosures) {
+        Closure<? super E>[] trs = null;
+        Predicate<E>[] preds = null;
         if (objectsAndClosures == null) {
             throw new IllegalArgumentException("The object and closure map 
must not be null");
         }
-        Closure def = (Closure) objectsAndClosures.remove(null);
+        Closure<? super E> def = objectsAndClosures.remove(null);
         int size = objectsAndClosures.size();
         trs = new Closure[size];
         preds = new Predicate[size];
         int i = 0;
-        for (Iterator it = objectsAndClosures.entrySet().iterator(); 
it.hasNext();) {
-            Map.Entry entry = (Map.Entry) it.next();
-            preds[i] = EqualPredicate.equalPredicate(entry.getKey());
-            trs[i] = (Closure) entry.getValue();
+        for (Map.Entry<? extends E, Closure<E>> entry : 
objectsAndClosures.entrySet()) {
+            preds[i] = EqualPredicate.<E>equalPredicate(entry.getKey());
+            trs[i] = entry.getValue();
             i++;
         }
-        return switchClosure(preds, trs, def);
+        return ClosureUtils.<E>switchClosure(preds, trs, def);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/CollectionUtils.java 
b/src/java/org/apache/commons/collections/CollectionUtils.java
index 3e96132..1208eb4 100644
--- a/src/java/org/apache/commons/collections/CollectionUtils.java
+++ b/src/java/org/apache/commons/collections/CollectionUtils.java
@@ -63,9 +63,9 @@ public class CollectionUtils {
     private static class CardinalityHelper<O> {
         final Map<O, Integer> cardinalityA, cardinalityB;
         
-        public <I1 extends O, I2 extends O> CardinalityHelper(Iterable<I1> a, 
Iterable<I2> b) {
-            cardinalityA = CollectionUtils.<O, I1>getCardinalityMap(a);
-            cardinalityB = CollectionUtils.<O, I2>getCardinalityMap(b);
+        public CardinalityHelper(Iterable<? extends O> a, Iterable<? extends 
O> b) {
+            cardinalityA = CollectionUtils.<O>getCardinalityMap(a);
+            cardinalityB = CollectionUtils.<O>getCardinalityMap(b);
         }
         
         public final int max(Object obj) {
@@ -119,7 +119,6 @@ public class CollectionUtils {
             return newList;
         }
 
-
     }
 
     /**
@@ -292,9 +291,9 @@ public class CollectionUtils {
      *            super type of <I>.
      * @return the populated cardinality map
      */
-    public static <O, I extends O> Map<O, Integer> getCardinalityMap(final 
Iterable<I> coll) {
+    public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? 
extends O> coll) {
         Map<O, Integer> count = new HashMap<O, Integer>();
-        for (I obj : coll) {
+        for (O obj : coll) {
             Integer c = count.get(obj);
             if (c == null) {
                 count.put(obj, 1);
@@ -490,7 +489,8 @@ public class CollectionUtils {
      * @param transformer
      *            the transformer to perform, may be null
      */
-    public static <C> void transform(Collection<C> collection, Transformer<? 
super C, ? extends C> transformer) {
+    public static <C> void transform(Collection<C> collection,
+            Transformer<? super C, ? extends C> transformer) {
         if (collection != null && transformer != null) {
             if (collection instanceof List) {
                 List<C> list = (List<C>) collection;
@@ -567,7 +567,8 @@ public class CollectionUtils {
      * @throws NullPointerException
      *             if the input collection is null
      */
-    public static <O, I extends O> Collection<O> select(Collection<I> 
inputCollection, Predicate<? super I> predicate) {
+    public static <O> Collection<O> select(Collection<? extends O> 
inputCollection,
+            Predicate<? super O> predicate) {
         return select(inputCollection, predicate, new 
ArrayList<O>(inputCollection.size()));
     }
 
@@ -586,9 +587,10 @@ public class CollectionUtils {
      *            the collection to output into, may not be null
      * @return outputCollection
      */
-    public static <O, I extends O, R extends Collection<O>> R 
select(Collection<I> inputCollection, Predicate<? super I> predicate, R 
outputCollection) {
+    public static <O, R extends Collection<? super O>> R select(Collection<? 
extends O> inputCollection,
+            Predicate<? super O> predicate, R outputCollection) {
         if (inputCollection != null && predicate != null) {
-            for (I item : inputCollection) {
+            for (O item : inputCollection) {
                 if (predicate.evaluate(item)) {
                     outputCollection.add(item);
                 }
@@ -612,7 +614,8 @@ public class CollectionUtils {
      * @throws NullPointerException
      *             if the input collection is null
      */
-    public static <O, I extends O> Collection<O> selectRejected(Collection<I> 
inputCollection, Predicate<? super I> predicate) {
+    public static <O> Collection<O> selectRejected(Collection<? extends O> 
inputCollection,
+            Predicate<? super O> predicate) {
         return selectRejected(inputCollection, predicate, new 
ArrayList<O>(inputCollection.size()));
     }
 
@@ -631,9 +634,10 @@ public class CollectionUtils {
      *            the collection to output into, may not be null
      * @return outputCollection
      */
-    public static <O, I extends O, R extends Collection<O>> R 
selectRejected(Collection<I> inputCollection, Predicate<? super I> predicate, R 
outputCollection) {
+    public static <O, R extends Collection<? super O>> R selectRejected(
+            Collection<? extends O> inputCollection, Predicate<? super O> 
predicate, R outputCollection) {
         if (inputCollection != null && predicate != null) {
-            for (I item : inputCollection) {
+            for (O item : inputCollection) {
                 if (!predicate.evaluate(item)) {
                     outputCollection.add(item);
                 }
@@ -658,7 +662,8 @@ public class CollectionUtils {
      * @throws NullPointerException
      *             if the input collection is null
      */
-    public static <I,O> Collection<O> collect(Iterable<I> inputCollection, 
Transformer<? super I, ? extends O> transformer) {
+    public static <I, O> Collection<O> collect(Iterable<I> inputCollection,
+            Transformer<? super I, ? extends O> transformer) {
         ArrayList<O> answer = new ArrayList<O>();
         collect(inputCollection, transformer, answer);
         return answer;
@@ -679,7 +684,8 @@ public class CollectionUtils {
      * @param <O> the type of object in the output collection
      * @return the transformed result (new list)
      */
-    public static <I,O> Collection<O> collect(Iterator<I> inputIterator, 
Transformer<? super I, ? extends O> transformer) {
+    public static <I, O> Collection<O> collect(Iterator<I> inputIterator,
+            Transformer<? super I, ? extends O> transformer) {
         ArrayList<O> answer = new ArrayList<O>();
         collect(inputIterator, transformer, answer);
         return answer;
@@ -701,7 +707,8 @@ public class CollectionUtils {
      * @return the outputCollection with the transformed input added
      * @throws NullPointerException if the output collection is null
      */
-    public static <I,O,T extends O, R extends Collection<O>> R 
collect(Iterable<I> inputCollection, final Transformer<? super I,T> 
transformer, final R outputCollection) {
+    public static <I, O, R extends Collection<? super O>> R collect(Iterable<? 
extends I> inputCollection,
+            final Transformer<? super I, ? extends O> transformer, final R 
outputCollection) {
         if (inputCollection != null) {
             return collect(inputCollection.iterator(), transformer, 
outputCollection);
         }
@@ -725,11 +732,12 @@ public class CollectionUtils {
      * @throws NullPointerException if the output collection is null
      */
     //TODO - deprecate and replace with IteratorIterable
-    public static <I,O,T extends O, R extends Collection<O>> R 
collect(Iterator<I> inputIterator, final Transformer<? super I,T> transformer, 
final R outputCollection) {
+    public static <I, O, R extends Collection<? super O>> R collect(Iterator<? 
extends I> inputIterator,
+            final Transformer<? super I, ? extends O> transformer, final R 
outputCollection) {
         if (inputIterator != null && transformer != null) {
             while (inputIterator.hasNext()) {
                 I item = inputIterator.next();
-                T value = transformer.transform(item);
+                O value = transformer.transform(item);
                 outputCollection.add(value);
             }
         }
@@ -813,7 +821,7 @@ public class CollectionUtils {
      * @throws NullPointerException
      *             if the collection or array is null
      */
-    public static <C, T extends C> void addAll(Collection<C> collection, T[] 
elements) {
+    public static <C> void addAll(Collection<C> collection, C[] elements) {
         for (int i = 0, size = elements.length; i < size; i++) {
             collection.add(elements[i]);
         }
@@ -913,13 +921,13 @@ public class CollectionUtils {
             throw new IndexOutOfBoundsException("Index cannot be negative: " + 
i);
         }
         if (object instanceof Map) {
-            Map map = (Map) object;
-            Iterator iterator = map.entrySet().iterator();
+            Map<?, ?> map = (Map<?, ?>) object;
+            Iterator<?> iterator = map.entrySet().iterator();
             return get(iterator, i);
         } else if (object instanceof Object[]) {
             return ((Object[]) object)[i];
         } else if (object instanceof Iterator) {
-            Iterator it = (Iterator) object;
+            Iterator<?> it = (Iterator<?>) object;
             while (it.hasNext()) {
                 i--;
                 if (i == -1) {
@@ -929,10 +937,10 @@ public class CollectionUtils {
             }
             throw new IndexOutOfBoundsException("Entry does not exist: " + i);
         } else if (object instanceof Collection) {
-            Iterator iterator = ((Collection) object).iterator();
+            Iterator<?> iterator = ((Collection<?>) object).iterator();
             return get(iterator, i);
         } else if (object instanceof Enumeration) {
-            Enumeration it = (Enumeration) object;
+            Enumeration<?> it = (Enumeration<?>) object;
             while (it.hasMoreElements()) {
                 i--;
                 if (i == -1) {
@@ -987,19 +995,19 @@ public class CollectionUtils {
     public static int size(Object object) {
         int total = 0;
         if (object instanceof Map) {
-            total = ((Map) object).size();
+            total = ((Map<?, ?>) object).size();
         } else if (object instanceof Collection) {
-            total = ((Collection) object).size();
+            total = ((Collection<?>) object).size();
         } else if (object instanceof Object[]) {
             total = ((Object[]) object).length;
         } else if (object instanceof Iterator) {
-            Iterator it = (Iterator) object;
+            Iterator<?> it = (Iterator<?>) object;
             while (it.hasNext()) {
                 total++;
                 it.next();
             }
         } else if (object instanceof Enumeration) {
-            Enumeration it = (Enumeration) object;
+            Enumeration<?> it = (Enumeration<?>) object;
             while (it.hasMoreElements()) {
                 total++;
                 it.nextElement();
@@ -1038,15 +1046,15 @@ public class CollectionUtils {
      */
     public static boolean sizeIsEmpty(Object object) {
         if (object instanceof Collection) {
-            return ((Collection) object).isEmpty();
+            return ((Collection<?>) object).isEmpty();
         } else if (object instanceof Map) {
-            return ((Map) object).isEmpty();
+            return ((Map<?, ?>) object).isEmpty();
         } else if (object instanceof Object[]) {
             return ((Object[]) object).length == 0;
         } else if (object instanceof Iterator) {
-            return ((Iterator) object).hasNext() == false;
+            return ((Iterator<?>) object).hasNext() == false;
         } else if (object instanceof Enumeration) {
-            return ((Enumeration) object).hasMoreElements() == false;
+            return ((Enumeration<?>) object).hasMoreElements() == false;
         } else if (object == null) {
             throw new IllegalArgumentException("Unsupported object type: 
null");
         } else {
@@ -1068,7 +1076,7 @@ public class CollectionUtils {
      * @return true if empty or null
      * @since Commons Collections 3.2
      */
-    public static boolean isEmpty(Collection coll) {
+    public static boolean isEmpty(Collection<?> coll) {
         return (coll == null || coll.isEmpty());
     }
 
@@ -1081,7 +1089,7 @@ public class CollectionUtils {
      * @return true if non-null and non-empty
      * @since Commons Collections 3.2
      */
-    public static boolean isNotEmpty(Collection coll) {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
 
@@ -1120,17 +1128,17 @@ public class CollectionUtils {
      * @return true if the BoundedCollection is full
      * @throws NullPointerException if the collection is null
      */
-    public static boolean isFull(Collection coll) {
+    @SuppressWarnings("unchecked")
+    public static boolean isFull(Collection<?> coll) {
         if (coll == null) {
             throw new NullPointerException("The collection must not be null");
         }
         if (coll instanceof BoundedCollection) {
-            return ((BoundedCollection) coll).isFull();
+            return ((BoundedCollection<?>) coll).isFull();
         }
         try {
-            BoundedCollection bcoll = 
UnmodifiableBoundedCollection.decorateUsing(coll);
+            BoundedCollection<?> bcoll = 
UnmodifiableBoundedCollection.decorateUsing((Collection<Object>) coll);
             return bcoll.isFull();
-
         } catch (IllegalArgumentException ex) {
             return false;
         }
@@ -1151,17 +1159,17 @@ public class CollectionUtils {
      * @return the maximum size of the BoundedCollection, -1 if no maximum size
      * @throws NullPointerException if the collection is null
      */
-    public static int maxSize(Collection coll) {
+    @SuppressWarnings("unchecked")
+    public static int maxSize(Collection<?> coll) {
         if (coll == null) {
             throw new NullPointerException("The collection must not be null");
         }
         if (coll instanceof BoundedCollection) {
-            return ((BoundedCollection) coll).maxSize();
+            return ((BoundedCollection<?>) coll).maxSize();
         }
         try {
-            BoundedCollection bcoll = 
UnmodifiableBoundedCollection.decorateUsing(coll);
+            BoundedCollection<?> bcoll = 
UnmodifiableBoundedCollection.decorateUsing((Collection<Object>) coll);
             return bcoll.maxSize();
-
         } catch (IllegalArgumentException ex) {
             return -1;
         }
@@ -1203,7 +1211,7 @@ public class CollectionUtils {
      * @throws NullPointerException if either parameter is null
      * @since Commons Collections 3.3 (method existed in 3.2 but was 
completely broken)
      */
-    public static Collection removeAll(Collection collection, Collection 
remove) {
+    public static <E> Collection<E> removeAll(Collection<E> collection, 
Collection<?> remove) {
         return ListUtils.removeAll(collection, remove);
     }
 
@@ -1277,7 +1285,7 @@ public class CollectionUtils {
      * @return a transformed collection backed by the given collection
      * @throws IllegalArgumentException  if the Collection or Transformer is 
null
      */
-    public static Collection transformedCollection(Collection collection, 
Transformer transformer) {
+    public static <E> Collection<E> transformedCollection(Collection<E> 
collection, Transformer<? super E, ? extends E> transformer) {
         return TransformedCollection.decorate(collection, transformer);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/ComparatorUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/ComparatorUtils.java 
b/src/java/org/apache/commons/collections/ComparatorUtils.java
index 2fed50f..c625745 100644
--- a/src/java/org/apache/commons/collections/ComparatorUtils.java
+++ b/src/java/org/apache/commons/collections/ComparatorUtils.java
@@ -54,14 +54,16 @@ public class ComparatorUtils {
      *
      * @see ComparableComparator#getInstance
      */
-    public static final Comparator NATURAL_COMPARATOR = 
ComparableComparator.getInstance();
+    @SuppressWarnings("unchecked")
+    public static final Comparator NATURAL_COMPARATOR = 
ComparableComparator.<Comparable>getInstance();
 
     /**
      * Gets a comparator that uses the natural order of the objects.
      *
      * @return  a comparator which uses natural order
      */
-    public static Comparator naturalComparator() {
+    @SuppressWarnings("unchecked")
+    public static <E extends Comparable<? super E>> Comparator<E> 
naturalComparator() {
         return NATURAL_COMPARATOR;
     }
 
@@ -76,7 +78,8 @@ public class ComparatorUtils {
      * @throws NullPointerException if either comparator is null
      * @see ComparatorChain
      */
-    public static Comparator chainedComparator(Comparator comparator1, 
Comparator comparator2) {
+    @SuppressWarnings("unchecked")
+    public static <E extends Comparable<? super E>> Comparator<E> 
chainedComparator(Comparator<E> comparator1, Comparator<E> comparator2) {
         return chainedComparator(new Comparator[] {comparator1, comparator2});
     }
 
@@ -89,8 +92,8 @@ public class ComparatorUtils {
      * @throws NullPointerException if comparators array is null or contains a 
null
      * @see ComparatorChain
      */
-    public static Comparator chainedComparator(Comparator[] comparators) {
-        ComparatorChain chain = new ComparatorChain();
+    public static <E extends Comparable<? super E>> Comparator<E> 
chainedComparator(Comparator<E>[] comparators) {
+        ComparatorChain<E> chain = new ComparatorChain<E>();
         for (int i = 0; i < comparators.length; i++) {
             if (comparators[i] == null) {
                 throw new NullPointerException("Comparator cannot be null");
@@ -111,9 +114,10 @@ public class ComparatorUtils {
      * @throws ClassCastException if the comparators collection contains the 
wrong object type
      * @see ComparatorChain
      */
-    public static Comparator chainedComparator(Collection comparators) {
+    @SuppressWarnings("unchecked")
+    public static <E extends Comparable<? super E>> Comparator<E> 
chainedComparator(Collection<Comparator<E>> comparators) {
         return chainedComparator(
-            (Comparator[]) comparators.toArray(new 
Comparator[comparators.size()])
+            (Comparator<E>[]) comparators.toArray(new 
Comparator[comparators.size()])
         );
     }
 
@@ -124,11 +128,8 @@ public class ComparatorUtils {
      * @return  a comparator that reverses the order of the input comparator
      * @see ReverseComparator
      */
-    public static Comparator reversedComparator(Comparator comparator) {
-        if (comparator == null) {
-            comparator = NATURAL_COMPARATOR;
-        }
-        return new ReverseComparator(comparator);
+    public static <E> Comparator<E> reversedComparator(Comparator<E> 
comparator) {
+        return new ReverseComparator<E>(comparator);
     }
 
     /**
@@ -143,7 +144,7 @@ public class ComparatorUtils {
      *        <code>false</code> {@link Boolean}s.
      * @return  a comparator that sorts booleans
      */
-    public static Comparator booleanComparator(boolean trueFirst) {
+    public static Comparator<Boolean> booleanComparator(boolean trueFirst) {
         return BooleanComparator.getBooleanComparator(trueFirst);
     }
     
@@ -158,11 +159,12 @@ public class ComparatorUtils {
      * @return  a version of that comparator that allows nulls
      * @see NullComparator
      */
-    public static Comparator nullLowComparator(Comparator comparator) {
+    @SuppressWarnings("unchecked")
+    public static <E> Comparator<E> nullLowComparator(Comparator<E> 
comparator) {
         if (comparator == null) {
             comparator = NATURAL_COMPARATOR;
         }
-        return new NullComparator(comparator, false);
+        return new NullComparator<E>(comparator, false);
     }
 
     /**
@@ -176,11 +178,12 @@ public class ComparatorUtils {
      * @return  a version of that comparator that allows nulls
      * @see NullComparator
      */
-    public static Comparator nullHighComparator(Comparator comparator) {
+    @SuppressWarnings("unchecked")
+    public static <E> Comparator<E> nullHighComparator(Comparator<E> 
comparator) {
         if (comparator == null) {
             comparator = NATURAL_COMPARATOR;
         }
-        return new NullComparator(comparator, true);
+        return new NullComparator<E>(comparator, true);
     }
 
     /**
@@ -195,11 +198,12 @@ public class ComparatorUtils {
      * @return  a comparator that transforms its input objects before 
comparing them
      * @see  TransformingComparator
      */
-    public static Comparator transformedComparator(Comparator comparator, 
Transformer transformer) {
+    @SuppressWarnings("unchecked")
+    public static <E> Comparator<E> transformedComparator(Comparator<E> 
comparator, Transformer<? super E, ? extends E> transformer) {
         if (comparator == null) {
             comparator = NATURAL_COMPARATOR;
         }
-        return new TransformingComparator(transformer, comparator);
+        return new TransformingComparator<E>(transformer, comparator);
     }
 
     /**
@@ -212,7 +216,8 @@ public class ComparatorUtils {
      *  @param comparator  the sort order to use
      *  @return  the smaller of the two objects
      */
-    public static Object min(Object o1, Object o2, Comparator comparator) {
+    @SuppressWarnings("unchecked")
+    public static <E> E min(E o1, E o2, Comparator<E> comparator) {
         if (comparator == null) {
             comparator = NATURAL_COMPARATOR;
         }
@@ -230,7 +235,8 @@ public class ComparatorUtils {
      *  @param comparator  the sort order to use
      *  @return  the larger of the two objects
      */
-    public static Object max(Object o1, Object o2, Comparator comparator) {
+    @SuppressWarnings("unchecked")
+    public static <E> E max(E o1, E o2, Comparator<E> comparator) {
         if (comparator == null) {
             comparator = NATURAL_COMPARATOR;
         }

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/EnumerationUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/EnumerationUtils.java 
b/src/java/org/apache/commons/collections/EnumerationUtils.java
index ec3b6e7..1a7b52f 100644
--- a/src/java/org/apache/commons/collections/EnumerationUtils.java
+++ b/src/java/org/apache/commons/collections/EnumerationUtils.java
@@ -16,8 +16,10 @@
  */
 package org.apache.commons.collections;
 
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.StringTokenizer;
 
 import org.apache.commons.collections.iterators.EnumerationIterator;
 
@@ -47,8 +49,21 @@ public class EnumerationUtils {
      * @param enumeration  the enumeration to traverse, which should not be 
<code>null</code>.
      * @throws NullPointerException if the enumeration parameter is 
<code>null</code>.
      */
-    public static List toList(Enumeration enumeration) {
-        return IteratorUtils.toList(new EnumerationIterator(enumeration));
+    public static <E> List<E> toList(Enumeration<E> enumeration) {
+        return IteratorUtils.toList(new EnumerationIterator<E>(enumeration));
     }
 
+    /**
+     * Override toList(Enumeration) for StringTokenizer as it implements 
Enumeration<String>
+     * for the sake of backward compatibility.
+     * @param stringTokenizer
+     * @return List<String>
+     */
+    public static List<String> toList(StringTokenizer stringTokenizer) {
+        List<String> result = new 
ArrayList<String>(stringTokenizer.countTokens());
+        while (stringTokenizer.hasMoreTokens()) {
+            result.add(stringTokenizer.nextToken());
+        }
+        return result;
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/FactoryUtils.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/FactoryUtils.java 
b/src/java/org/apache/commons/collections/FactoryUtils.java
index bdd991f..59b02fc 100644
--- a/src/java/org/apache/commons/collections/FactoryUtils.java
+++ b/src/java/org/apache/commons/collections/FactoryUtils.java
@@ -55,8 +55,8 @@ public class FactoryUtils {
      * 
      * @return the factory
      */
-    public static Factory exceptionFactory() {
-        return ExceptionFactory.INSTANCE;
+    public static <T> Factory<T> exceptionFactory() {
+        return ExceptionFactory.<T>getInstance();
     }
 
     /**
@@ -68,7 +68,7 @@ public class FactoryUtils {
      * @return the factory
      */
     public static <T> Factory<T> nullFactory() {
-        return ConstantFactory.NULL_INSTANCE;
+        return ConstantFactory.<T>getInstance(null);
     }
 
     /**
@@ -82,7 +82,7 @@ public class FactoryUtils {
      * @param constantToReturn  the constant object to return each time in the 
factory
      * @return the <code>constant</code> factory.
      */
-    public static Factory constantFactory(Object constantToReturn) {
+    public static <T> Factory<T> constantFactory(T constantToReturn) {
         return ConstantFactory.getInstance(constantToReturn);
     }
 
@@ -103,8 +103,8 @@ public class FactoryUtils {
      * @throws IllegalArgumentException if the prototype is null
      * @throws IllegalArgumentException if the prototype cannot be cloned
      */
-    public static Factory prototypeFactory(Object prototype) {
-        return PrototypeFactory.getInstance(prototype);
+    public static <T> Factory<T> prototypeFactory(T  prototype) {
+        return PrototypeFactory.<T>getInstance(prototype);
     }
 
     /**
@@ -135,7 +135,7 @@ public class FactoryUtils {
      * @throws IllegalArgumentException if the paramTypes and args don't match
      * @throws IllegalArgumentException if the constructor doesn't exist
      */
-    public static <T> Factory<T> instantiateFactory(Class<T> 
classToInstantiate, Class[] paramTypes, Object[] args) {
+    public static <T> Factory<T> instantiateFactory(Class<T> 
classToInstantiate, Class<?>[] paramTypes, Object[] args) {
         return InstantiateFactory.getInstance(classToInstantiate, paramTypes, 
args);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/884baf0d/src/java/org/apache/commons/collections/FunctorException.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/commons/collections/FunctorException.java 
b/src/java/org/apache/commons/collections/FunctorException.java
index 6651fc8..ce9166a 100644
--- a/src/java/org/apache/commons/collections/FunctorException.java
+++ b/src/java/org/apache/commons/collections/FunctorException.java
@@ -30,11 +30,14 @@ import java.io.PrintWriter;
  */
 public class FunctorException extends RuntimeException {
     
+    /** Serialization version */
+    private static final long serialVersionUID = 9139387246344345475L;
+
     /**
      * Does JDK support nested exceptions
      */
     private static final boolean JDK_SUPPORTS_NESTED;
-    
+
     static {
         boolean flag = false;
         try {
@@ -45,7 +48,7 @@ public class FunctorException extends RuntimeException {
         }
         JDK_SUPPORTS_NESTED = flag;
     }
-    
+
     /**
      * Root cause of the exception
      */

Reply via email to