### Question:
LongList { static int newCapacity(long minCapacity, long oldCapacity) { long growBy50Percent = oldCapacity + (oldCapacity >> 1); if (minCapacity <= growBy50Percent) { return (int) growBy50Percent; } else if (minCapacity <= MAX_ARRAY_SIZE) { return (int) minCapacity; } else { throw new OutOfMemoryError(); } } LongList();  LongList(int initialCapacity); static LongList of(long... values); void add(long l); void addAll(LongList other); int getSize(); long get(int i); boolean contains(long l); boolean remove(long l); long remove(int i); void clear(); @Override String toString(); long[] toArray(); boolean isEmpty();  }### Answer:
@Test void testNewCapacity() { assertThat(LongList.newCapacity(1, 0)).isEqualTo(1); assertThat(LongList.newCapacity(42, 4)).isEqualTo(42); assertThat(LongList.newCapacity(5, 4)).isEqualTo(6); assertThatThrownBy(() -> LongList.newCapacity(Integer.MAX_VALUE, 4)).isInstanceOf(OutOfMemoryError.class); }