Buggy code:
public final class MappeableArrayContainer extends MappeableContainer implements Cloneable { private static final int DEFAULT_INIT_SIZE = 4 ; protected static final int DEFAULT_MAX_SIZE = 4096 ; protected int cardinality = 0 ; private static final long serialVersionUID = 1L ; protected ShortBuffer content ; public MappeableArrayContainer ( ) { } public short [ ] toShortArray ( ) { } public MappeableArrayContainer ( final int capacity ) { } public MappeableArrayContainer ( final int firstOfRun , final int lastOfRun ) { } private MappeableArrayContainer ( int newCard , ShortBuffer newContent ) { } public MappeableArrayContainer ( final ShortBuffer array , final int cardinality ) { } public MappeableArrayContainer ( ArrayContainer bc ) { } @ Override int numberOfRuns ( ) { } @ Override public MappeableContainer add ( final short x ) { } @ Override public MappeableArrayContainer and ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer and ( MappeableBitmapContainer x ) { } @ Override public MappeableContainer and ( final MappeableRunContainer value2 ) { } @ Override public MappeableArrayContainer andNot ( final MappeableArrayContainer value2 ) { } @ Override public MappeableArrayContainer andNot ( MappeableBitmapContainer value2 ) { } @ Override public MappeableContainer andNot ( final MappeableRunContainer x ) { } @ Override public void clear ( ) { } @ Override public MappeableArrayContainer clone ( ) { } @ Override public boolean contains ( final short x ) { } @ Override public boolean equals ( Object o ) { } @ Override public void fillLeastSignificant16bits ( int [ ] x , int i , int mask ) { } @ Override protected int getArraySizeInBytes ( ) { } protected static int getArraySizeInBytes ( int cardinality ) { } @ Override public int getCardinality ( ) { } @ Override public ShortIterator getShortIterator ( ) { } @ Override public ShortIterator getReverseShortIterator ( ) { } @ Override public int getSizeInBytes ( ) { } @ Override public int hashCode ( ) { } @ Override public MappeableArrayContainer iand ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer iand ( MappeableBitmapContainer value2 ) { } @ Override public MappeableContainer iand ( final MappeableRunContainer value2 ) { } @ Override public MappeableArrayContainer iandNot ( final MappeableArrayContainer value2 ) { } @ Override public MappeableArrayContainer iandNot ( MappeableBitmapContainer value2 ) { } @ Override public MappeableContainer iandNot ( final MappeableRunContainer value2 ) { } private void increaseCapacity ( ) { } private void increaseCapacity ( boolean allowIllegalSize ) { int len = this . content . limit ( ) ; int newCapacity = ( len == 0 ) ? MappeableArrayContainer . DEFAULT_INIT_SIZE : len < 64 ? len * 2 : ( this . content . limit ( ) ) < 1067 ? ( len * 3 ) // 2 : ( len * 5 ) // 4 ; if ( ( newCapacity > ( MappeableArrayContainer . DEFAULT_MAX_SIZE ) ) && ( ! allowIllegalSize ) ) newCapacity = MappeableArrayContainer . DEFAULT_MAX_SIZE ; <START_BUG> if ( newCapacity < ( ( MappeableArrayContainer . DEFAULT_MAX_SIZE ) - ( ( MappeableArrayContainer . DEFAULT_MAX_SIZE ) // 16 ) ) ) <END_BUG> newCapacity = MappeableArrayContainer . DEFAULT_MAX_SIZE ; final ShortBuffer newContent = ShortBuffer . allocate ( newCapacity ) ; this . content . rewind ( ) ; newContent . put ( this . content ) ; this . content = newContent ; } private void increaseCapacity ( int min ) { } @ Override public MappeableContainer inot ( final int firstOfRange , final int lastOfRange ) { } @ Override public MappeableContainer ior ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer ior ( MappeableBitmapContainer x ) { } @ Override public MappeableContainer ior ( final MappeableRunContainer value2 ) { } @ Override public Iterator < Short > iterator ( ) { } @ Override public MappeableContainer ixor ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer ixor ( MappeableBitmapContainer x ) { } @ Override public MappeableContainer ixor ( final MappeableRunContainer value2 ) { } protected void loadData ( final MappeableBitmapContainer bitmapContainer ) { } private void negateRange ( final ShortBuffer buffer , final int startIndex , final int lastIndex , final int startRange , final int lastRange ) { } @ Override public MappeableContainer not ( final int firstOfRange , final int lastOfRange ) { } @ Override public MappeableContainer or ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer or ( MappeableBitmapContainer x ) { } private int advance ( ShortIterator it ) { } private void emit ( short val ) { } private MappeableContainer or ( ShortIterator it , boolean exclusive ) { } protected MappeableContainer or ( ShortIterator it ) { } protected MappeableContainer xor ( ShortIterator it ) { } @ Override public MappeableContainer or ( final MappeableRunContainer value2 ) { } @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } @ Override public MappeableContainer remove ( final short x ) { } @ Override public int serializedSizeInBytes ( ) { } protected static int serializedSizeInBytes ( int cardinality ) { } public MappeableBitmapContainer 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 MappeableContainer xor ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer xor ( MappeableBitmapContainer x ) { } @ Override public MappeableContainer xor ( final MappeableRunContainer value2 ) { } @ Override public int rank ( short lowbits ) { } @ Override public short select ( int j ) { } @ Override public MappeableContainer limit ( int maxcardinality ) { } @ Override public MappeableContainer flip ( short x ) { } @ Override public MappeableContainer add ( int begin , int end ) { }

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