boolean (@NotNull Collection<? extends E> c) { if (c.isEmpty()) return false; Object[] cs = c.toArray(); //could still be empty for concurrent collection //noinspection ConstantConditions if (cs.length == 0) { return false; } while (true) { Object[] elements = get(); Object[] newElements = createArrayAddAll(elements, cs); if (replaceArray(elements, newElements)) return true; } }