### Question:
TinySet extends AbstractProxySet<E> { public static <T> Set<T> addAll(Set<T> input, Collection<? extends T> c) { if (c.isEmpty()) { return input; } else if (input.isEmpty()) { if (c.size() == 1) { return Collections.<T>singleton(c.iterator().next()); } Set<T> result = New.set(c); if (result.size() == 1) { result = Collections.<T>singleton(c.iterator().next()); } return result; } else if (input.size() == 1) { Set<T> result = New.set(c.size() + 1); result.addAll(input); if (result.addAll(c)) { return result; } return input; } else { input.addAll(c); return input; } }  static Set<T> add(Set<T> input, T e); static Set<T> addAll(Set<T> input, Collection<? extends T> c); static Set<T> remove(Set<T> set, Object o); static Set<T> removeAll(Set<T> set, Collection<T> c); static Set<T> retainAll(Set<T> mySet, Collection<?> c); @Override boolean add(E e); @Override boolean addAll(Collection<? extends E> c); @Override void clear(); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c);  }### Answer:
@Test public void testAddAll() { TinySet<Object> set = new TinySet<>(); checkSize0(set); Assert.assertTrue(set.addAll(Arrays.asList(TEST_OBJ1))); checkSize1(set); Assert.assertTrue(set.addAll(Arrays.asList(TEST_OBJ1, TEST_OBJ2))); checkSizeN(set, 2); Assert.assertFalse(set.addAll(Arrays.asList(TEST_OBJ1))); checkSizeN(set, 2); Assert.assertFalse(set.addAll(Arrays.asList(TEST_OBJ1, TEST_OBJ2))); checkSizeN(set, 2); Assert.assertTrue(set.addAll(Arrays.asList(TEST_OBJ1, TEST_OBJ2, TEST_OBJ3))); checkSizeN(set, 3); Assert.assertFalse(set.addAll(Collections.emptySet())); checkSizeN(set, 3); }
@Test public void testStaticAddAll() { Set<Object> set = Collections.emptySet(); checkSize0(set); set = TinySet.addAll(set, Collections.emptySet()); checkSize0(set); set = TinySet.addAll(set, Arrays.asList(TEST_OBJ1)); checkSize1(set); set = TinySet.addAll(set, Arrays.asList(TEST_OBJ1, TEST_OBJ2)); checkSizeN(set, 2); set = TinySet.addAll(set, Arrays.asList(TEST_OBJ1)); checkSizeN(set, 2); set = TinySet.addAll(set, Arrays.asList(TEST_OBJ1, TEST_OBJ2)); checkSizeN(set, 2); set = TinySet.addAll(set, Arrays.asList(TEST_OBJ1, TEST_OBJ2, TEST_OBJ3)); checkSizeN(set, 3); }