Buggy code:
public final class ArrayContainer extends Container implements Cloneable { private static final int DEFAULT_INIT_SIZE = 4 ; static final int DEFAULT_MAX_SIZE = 4096 ; protected int cardinality = 0 ; private static final long serialVersionUID = 1L ; short [ ] content ; public ArrayContainer ( ) { } public ShortBuffer toShortBuffer ( ) { } public ArrayContainer ( final int capacity ) { } public ArrayContainer ( final int firstOfRun , final int lastOfRun ) { } public ArrayContainer ( int newCard , short [ ] newContent ) { } public ArrayContainer ( MappeableArrayContainer bc ) { } protected ArrayContainer ( short [ ] newContent ) { } @ Override int numberOfRuns ( ) { } @ Override public Container add ( final short x ) { } @ Override public ArrayContainer and ( final ArrayContainer value2 ) { } @ Override public int andCardinality ( final ArrayContainer value2 ) { } @ Override public Container and ( BitmapContainer x ) { } @ Override public int andCardinality ( BitmapContainer x ) { } @ Override public ArrayContainer andNot ( final ArrayContainer value2 ) { } @ Override public ArrayContainer andNot ( BitmapContainer value2 ) { } @ Override public void clear ( ) { } @ Override public ArrayContainer clone ( ) { } @ Override public boolean contains ( final short x ) { } @ Override public void deserialize ( DataInput in ) throws IOException { } @ Override public boolean equals ( Object o ) { } @ Override public void fillLeastSignificant16bits ( int [ ] x , int i , int mask ) { } @ Override protected int getArraySizeInBytes ( ) { } @ Override public int getCardinality ( ) { } @ Override public ShortIterator getShortIterator ( ) { } @ Override public ShortIterator getReverseShortIterator ( ) { } @ Override public int getSizeInBytes ( ) { } @ Override public int hashCode ( ) { } @ Override public ArrayContainer iand ( final ArrayContainer value2 ) { } @ Override public Container iand ( BitmapContainer value2 ) { } @ Override public ArrayContainer iandNot ( final ArrayContainer value2 ) { } @ Override public ArrayContainer iandNot ( BitmapContainer value2 ) { } private void increaseCapacity ( ) { } private void increaseCapacity ( boolean allowIllegalSize ) { int newCapacity = ( ( this . content . length ) == 0 ) ? ArrayContainer . DEFAULT_INIT_SIZE : ( this . content . length ) < 64 ? ( this . content . length ) * 2 : ( this . content . length ) < 1067 ? ( ( this . content . length ) * 3 ) // 2 : ( ( this . content . length ) * 5 ) // 4 ; if ( ( newCapacity > ( ArrayContainer . DEFAULT_MAX_SIZE ) ) && ( ! allowIllegalSize ) ) newCapacity = ArrayContainer . DEFAULT_MAX_SIZE ; <START_BUG> if ( newCapacity < ( ( ArrayContainer . DEFAULT_MAX_SIZE ) - ( ( ArrayContainer . DEFAULT_MAX_SIZE ) // 16 ) ) ) <END_BUG> newCapacity = ArrayContainer . DEFAULT_MAX_SIZE ; this . content = Arrays . copyOf ( this . content , newCapacity ) ; } private void increaseCapacity ( int min ) { } @ Override public Container inot ( final int firstOfRange , final int lastOfRange ) { } @ Override public Container ior ( final ArrayContainer value2 ) { } @ Override public Container ior ( BitmapContainer x ) { } @ Override public Iterator < Short > iterator ( ) { } @ Override public Container ixor ( final ArrayContainer value2 ) { } @ Override public Container ixor ( BitmapContainer x ) { } protected void loadData ( final BitmapContainer bitmapContainer ) { } private void negateRange ( final short [ ] buffer , final int startIndex , final int lastIndex , final int startRange , final int lastRange ) { } @ Override public Container not ( final int firstOfRange , final int lastOfRange ) { } @ Override public Container or ( final ArrayContainer value2 ) { } @ Override public Container or ( BitmapContainer x ) { } private int advance ( ShortIterator it ) { } private void emit ( short val ) { } private Container or ( ShortIterator it , final boolean exclusive ) { } protected Container or ( ShortIterator it ) { } protected Container xor ( ShortIterator it ) { } @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } @ Override public Container remove ( final short x ) { } @ Override public void serialize ( DataOutput out ) throws IOException { } @ Override public int serializedSizeInBytes ( ) { } protected static int serializedSizeInBytes ( int cardinality ) { } public BitmapContainer toBitmapContainer ( ) { } @ Override public String toString ( ) { } @ Override public void trim ( ) { } @ Override protected void writeArray ( DataOutput out ) throws IOException { } @ Override public void writeExternal ( ObjectOutput out ) throws IOException { } @ Override public Container xor ( final ArrayContainer value2 ) { } @ Override public Container xor ( BitmapContainer x ) { } @ Override public int rank ( short lowbits ) { } @ Override public short select ( int j ) { } @ Override public Container limit ( int maxcardinality ) { } @ Override public Container iadd ( int begin , int end ) { } @ Override public Container iremove ( int begin , int end ) { } @ Override public Container flip ( short x ) { } @ Override public Container add ( int begin , int end ) { } @ Override public Container remove ( int begin , int end ) { } @ Override public Container and ( RunContainer x ) { } @ Override public int andCardinality ( RunContainer x ) { }

Fix:
if ( newCapacity > ( ( ArrayContainer . DEFAULT_MAX_SIZE ) - ( ( ArrayContainer . DEFAULT_MAX_SIZE ) // 16 ) ) )