# Deprecated API

## Contents

- Interfaces
- Classes
- Methods
- Constructors

- Deprecated Interfaces
  Interface
  Description
  org.apache.commons.collections4.Bag
  Since 4.6.0, use `MultiSet` instead; see the migration notes above.
  org.apache.commons.collections4.MultiMap
  Since 4.1, use `MultiValuedMap` instead
  org.apache.commons.collections4.SortedBag
  Since 4.6.0, use `SortedMultiSet` instead; see the `Bag` Javadoc for migration notes.

- Deprecated Classes
  Class
  Description
  org.apache.commons.collections4.ArrayStack
  Use `ArrayDeque` instead (available from Java 1.6)
  org.apache.commons.collections4.bag.AbstractBagDecorator
  Since 4.6.0, use `AbstractMultiSetDecorator` instead.
  org.apache.commons.collections4.bag.AbstractMapBag
  Since 4.6.0, use `AbstractMapMultiSet` instead.
  org.apache.commons.collections4.bag.AbstractSortedBagDecorator
  Since 4.6.0, use `AbstractSortedMultiSetDecorator` instead.
  org.apache.commons.collections4.bag.CollectionBag
  Since 4.6.0, no longer needed; a `MultiSet` already complies with the `Collection` contract.
  org.apache.commons.collections4.bag.CollectionSortedBag
  Since 4.6.0, no longer needed; a `SortedMultiSet` already complies with the `Collection` contract.
  org.apache.commons.collections4.bag.HashBag
  Since 4.6.0, use `HashMultiSet` instead.
  org.apache.commons.collections4.bag.PredicatedBag
  Since 4.6.0, use `PredicatedMultiSet` instead.
  org.apache.commons.collections4.bag.PredicatedSortedBag
  Since 4.6.0, use `PredicatedSortedMultiSet` instead.
  org.apache.commons.collections4.bag.SynchronizedBag
  Since 4.6.0, use `SynchronizedMultiSet` instead.
  org.apache.commons.collections4.bag.SynchronizedSortedBag
  Since 4.6.0, use `SynchronizedSortedMultiSet` instead.
  org.apache.commons.collections4.bag.TransformedBag
  Since 4.6.0, use `TransformedMultiSet` instead.
  org.apache.commons.collections4.bag.TransformedSortedBag
  Since 4.6.0, use `TransformedSortedMultiSet` instead.
  org.apache.commons.collections4.bag.TreeBag
  Since 4.6.0, use `TreeMultiSet` instead.
  org.apache.commons.collections4.bag.UnmodifiableBag
  Since 4.6.0, use `UnmodifiableMultiSet` instead.
  org.apache.commons.collections4.bag.UnmodifiableSortedBag
  Since 4.6.0, use `UnmodifiableSortedMultiSet` instead.
  org.apache.commons.collections4.BagUtils
  Since 4.6.0, use `MultiSetUtils` instead.
  org.apache.commons.collections4.list.AbstractLinkedList
  Use `AbstractLinkedListJava21` instead
  org.apache.commons.collections4.list.CursorableLinkedList
  parent `AbstractLinkedList` is source incompatible with List methods added in Java 21
  org.apache.commons.collections4.list.NodeCachingLinkedList
  parent `AbstractLinkedList` is source incompatible with List methods added in Java 21
  org.apache.commons.collections4.map.MultiValueMap
  Since 4.1, use `MultiValuedMap` instead

- Deprecated Methods
  Method
  Description
  org.apache.commons.collections4.collection.PredicatedCollection.Builder.createPredicatedBag()
  Since 4.6.0, use `PredicatedCollection.Builder.createPredicatedMultiSet()` instead.
  org.apache.commons.collections4.collection.PredicatedCollection.Builder.createPredicatedBag(Bag<E>)
  Since 4.6.0, use `PredicatedCollection.Builder.createPredicatedMultiSet(MultiSet)` instead.
  org.apache.commons.collections4.CollectionUtils.cardinality(O, Iterable<? super O>)
  Since 4.1, use `IterableUtils.frequency(Iterable, Object)` instead. Be aware that the order of parameters has changed.
  org.apache.commons.collections4.CollectionUtils.countMatches(Iterable<C>, Predicate<? super C>)
  Since 4.1, use `IterableUtils.countMatches(Iterable, Predicate)` instead.
  org.apache.commons.collections4.CollectionUtils.exists(Iterable<C>, Predicate<? super C>)
  Since 4.1, use `IterableUtils.matchesAny(Iterable, Predicate)` instead.
  org.apache.commons.collections4.CollectionUtils.find(Iterable<T>, Predicate<? super T>)
  Since 4.1, use `IterableUtils.find(Iterable, Predicate)` instead.
  org.apache.commons.collections4.CollectionUtils.forAllButLastDo(Iterable<T>, C)
  Since 4.1, use `IterableUtils.forEachButLast(Iterable, Closure)` instead.
  org.apache.commons.collections4.CollectionUtils.forAllButLastDo(Iterator<T>, C)
  Since 4.1, use `IteratorUtils.forEachButLast(Iterator, Closure)` instead.
  org.apache.commons.collections4.CollectionUtils.forAllDo(Iterable<T>, C)
  Since 4.1, use `IterableUtils.forEach(Iterable, Closure)` instead.
  org.apache.commons.collections4.CollectionUtils.forAllDo(Iterator<T>, C)
  Since 4.1, use `IteratorUtils.forEach(Iterator, Closure)` instead.
  org.apache.commons.collections4.CollectionUtils.get(Iterable<T>, int)
  Since 4.1, use `IterableUtils.get(Iterable, int)` instead.
  org.apache.commons.collections4.CollectionUtils.get(Iterator<T>, int)
  Since 4.1, use `IteratorUtils.get(Iterator, int)` instead.
  org.apache.commons.collections4.CollectionUtils.matchesAll(Iterable<C>, Predicate<? super C>)
  Since 4.1, use `IterableUtils.matchesAll(Iterable, Predicate)` instead
  org.apache.commons.collections4.CollectionUtils.synchronizedCollection(Collection<C>)
  Since 4.1, use `Collections.synchronizedCollection(Collection)` instead.
  org.apache.commons.collections4.CollectionUtils.unmodifiableCollection(Collection<? extends C>)
  Since 4.1, use `Collections.unmodifiableCollection(Collection)` instead.
  org.apache.commons.collections4.iterators.UnmodifiableListIterator.umodifiableListIterator(ListIterator<? extends E>)
  method name has typo in it. Use `UnmodifiableListIterator.unmodifiableListIterator(ListIterator)` instead.
  org.apache.commons.collections4.MapUtils.multiValueMap(Map<K, ? super Collection<V>>)
  Since 4.1, use `MultiValuedMap` instead
  org.apache.commons.collections4.MapUtils.multiValueMap(Map<K, C>, Class<C>)
  Since 4.1, use `MultiValuedMap` instead
  org.apache.commons.collections4.MapUtils.multiValueMap(Map<K, C>, Factory<C>)
  Since 4.1, use `MultiValuedMap` instead
  org.apache.commons.collections4.MultiMapUtils.getValuesAsBag(MultiValuedMap<K, V>, K)
  Since 4.6.0, use `MultiMapUtils.getValuesAsMultiSet(MultiValuedMap, Object)` instead.
  org.apache.commons.collections4.TransformerUtils.switchTransformer(Predicate<? super I>, Transformer<? super I, ? extends O>, Transformer<? super I, ? extends O>)
  as of 4.1, use `TransformerUtils.ifTransformer(Predicate, Transformer, Transformer)`

- Deprecated Constructors
  Constructor
  Description
  org.apache.commons.collections4.IterableUtils()
  TODO Make private in 5.0.
  org.apache.commons.collections4.trie.analyzer.StringKeyAnalyzer()
  Use `StringKeyAnalyzer.INSTANCE`.