### Question:
Bag extends AbstractCollection<T> implements Serializable { public Entry<T, Integer> getMax() { Entry<T, Integer> max = null; for (Entry<T, Integer> entry : unique()) { if (max == null || max.getValue() < entry.getValue()) { max = entry; } } return max; } Bag();  Bag(Map<? extends T, ? extends Integer> map); private  Bag(Map<T, Integer> map, int size);  Bag(Iterable<? extends T> iterable); @Deprecated static Bag<T> create(); @Deprecated static Bag<T> create(Iterable<? extends T> iterable); @Deprecated static Bag<T> create(Map<? extends T, ? extends Integer> map); @Override boolean add(T item); @Override Iterator<T> iterator(); @Override int size(); int add(T item, int increment); int removeAll(T item); int set(T item, int count); int count(T item); Set<Entry<T, Integer>> unique(); Set<T> uniqueItems(); Entry<T, Integer> getMax(); Entry<T, Integer> getMin(); Bag<T> createSorted(Order order); Map<T, Integer> toMap(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testMax() { assertEquals(ELEMENT2, bag1.getMax().getKey()); }