### Question:
Bag extends AbstractCollection<T> implements Serializable { @Override public int size() { return size; } 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 testSize() { assertEquals(3, bag1.unique().size()); assertEquals(10, bag1.size()); }
@Test public void test_setCountOnInit() { Map<String, Integer> counts = new HashMap<>(); counts.put("one", 1); counts.put("two", 2); Bag<String> bag = new Bag<>(counts); assertEquals(3, bag.size()); }