Hi Thomas,
thanks for this great work! :-)
I found the following issue that leads to unnecessary bad resize behaviour for large lists:
'GapList#calculateNewCapacity(int)' produces an (too early) overflow for 'oldCapacity'. For all capacities larger than 'Integer.MAX_VALUE / 3 + 1' the GapList will be resized by one (!) element. This has significant impact on adding new elements performance.
int oldCapacity = Integer.MAX_VALUE / 3 + 1;
int newCapacity = (oldCapacity * 3) / 2 + 1;
System.out.println(newCapacity); // -> -1073741822 -> OVERFLOW
A possible improvement looks like that ...
int oldCapacity = Integer.MAX_VALUE / 3 + 1;
int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
System.out.println(newCapacity); // -> 1073741825
Kind Regards!