@Override
	public boolean retainAll(Collection<?> c) {
		long[] newValues = new long[longs.length];
		int newIndex = 0;
		for(int i=0;i<size;i++) {
			if (c.contains(longs[i])) {
				newValues[newIndex++] = longs[i];
			}
		}
		longs = newValues;
		boolean changed = (size == newIndex);
		size = newIndex;
		return changed;
	}
Doubles the size of the array.
@param size The new capacity of the array.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/LongArrayList.java