Buggy code:
public final class MappeableArrayContainer extends MappeableContainer implements Serializable , Cloneable { private static final int DEFAULT_INIT_SIZE = 4 ; protected static final int DEFAULT_MAX_SIZE = 4096 ; private static final long serialVersionUID = 1L ; protected int cardinality = 0 ; protected ShortBuffer content ; public MappeableArrayContainer ( ) { } 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 ) { } @ Override public MappeableContainer add ( final short x ) { } @ Override public MappeableArrayContainer and ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer and ( MappeableBitmapContainer x ) { } @ Override public MappeableArrayContainer andNot ( final MappeableArrayContainer value2 ) { } @ Override public MappeableArrayContainer andNot ( MappeableBitmapContainer value2 ) { } @ 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 ( ) { } @ 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 MappeableArrayContainer iandNot ( final MappeableArrayContainer value2 ) { } @ Override public MappeableArrayContainer iandNot ( MappeableBitmapContainer value2 ) { } private void increaseCapacity ( ) { <START_BUG> int newCapacity = ( ( this . content . limit ( ) ) < 64 ) ? ( this . content . limit ( ) ) * 2 : ( this . content . limit ( ) ) < 1024 ? ( ( this . content . limit ( ) ) * 3 ) // 2 : ( ( this . content . limit ( ) ) * 5 ) // 4 ; <END_BUG> if ( newCapacity > ( MappeableArrayContainer . DEFAULT_MAX_SIZE ) ) newCapacity = MappeableArrayContainer . DEFAULT_MAX_SIZE ; final ShortBuffer newContent = ShortBuffer . allocate ( newCapacity ) ; this . content . rewind ( ) ; newContent . put ( this . content ) ; this . content = newContent ; } @ 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 Iterator < Short > iterator ( ) { } @ Override public MappeableContainer ixor ( final MappeableArrayContainer value2 ) { } @ Override public MappeableContainer ixor ( MappeableBitmapContainer x ) { } 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 ) { } @ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } @ Override public MappeableContainer remove ( final short x ) { } 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 int rank ( short lowbits ) { } @ Override public short select ( int j ) { } @ Override public MappeableContainer limit ( int maxcardinality ) { } }

Fix:
int newCapacity = ( ( this . content . limit ( ) ) == 0 ) ? MappeableArrayContainer . DEFAULT_INIT_SIZE : ( this . content . limit ( ) ) < 64 ? ( this . content . limit ( ) ) * 2 : ( this . content . limit ( ) ) < 1024 ? ( ( this . content . limit ( ) ) * 3 ) // 2 : ( ( this . content . limit ( ) ) * 5 ) // 4 ;