Buggy code:
public class OpenBitSet implements Serializable , Cloneable { protected long [ ] bits ; protected int wlen ; public OpenBitSet ( long numBits ) { } public OpenBitSet ( ) { } public OpenBitSet ( long [ ] bits , int numWords ) { } public long capacity ( ) { } public long size ( ) { } public boolean isEmpty ( ) { } public long [ ] getBits ( ) { } public void setBits ( long [ ] bits ) { } public int getNumWords ( ) { } public void setNumWords ( int nWords ) { } public boolean get ( int index ) { } public boolean fastGet ( int index ) { } public boolean get ( long index ) { } public boolean fastGet ( long index ) { } public int getBit ( int index ) { } public void set ( long index ) { } public void fastSet ( int index ) { } public void fastSet ( long index ) { } protected int expandingWordNum ( long index ) { } public void fastClear ( int index ) { } public void fastClear ( long index ) { } public void clear ( long index ) { } public boolean getAndSet ( int index ) { } public boolean getAndSet ( long index ) { } public void fastFlip ( int index ) { } public void fastFlip ( long index ) { } public void flip ( long index ) { } public boolean flipAndGet ( int index ) { } public boolean flipAndGet ( long index ) { } public void flip ( long startIndex , long endIndex ) { if ( endIndex <= startIndex ) return ; int oldlen = wlen ; ensureCapacity ( endIndex ) ; int startWord = ( ( int ) ( startIndex > > 6 ) ) ; int endWord = ( ( int ) ( endIndex > > 6 ) ) ; long startmask = ( - 1L ) << startIndex ; <START_BUG> long endmask = ( ( endIndex & 60 ) == 0 ) ? 0 : ( - 1L ) > > > ( 64 - endIndex ) ; <END_BUG> if ( ( this . wlen ) <= endWord ) { this . wlen = endWord ; if ( endmask != 0 ) ( this . wlen ) ++ ; } if ( startWord == endWord ) { bits [ startWord ] ^= startmask & endmask ; return ; } bits [ startWord ] ^= startmask ; int middle = Math . min ( oldlen , endWord ) ; for ( int i = startWord + 1 ; i < middle ; i ++ ) { bits [ i ] = ~ ( bits [ i ] ) ; } if ( endWord > middle ) { Arrays . fill ( bits , middle , endWord , ( - 1L ) ) ; } if ( endmask != 0 ) { bits [ endWord ] ^= endmask ; } } public long cardinality ( ) { } public static long intersectionCount ( OpenBitSet a , OpenBitSet b ) { } public static long unionCount ( OpenBitSet a , OpenBitSet b ) { } public static long andNotCount ( OpenBitSet a , OpenBitSet b ) { } public static long xorCount ( OpenBitSet a , OpenBitSet b ) { } public int nextSetBit ( int index ) { } public long nextSetBit ( long index ) { } public Object clone ( ) { } public void intersect ( OpenBitSet other ) { } public void union ( OpenBitSet other ) { } public void remove ( OpenBitSet other ) { } public void xor ( OpenBitSet other ) { } public void and ( OpenBitSet other ) { } public void or ( OpenBitSet other ) { } public void andNot ( OpenBitSet other ) { } public boolean intersects ( OpenBitSet other ) { } public void ensureCapacityWords ( int numWords ) { } public void ensureCapacity ( long numBits ) { } public void trimTrailingZeros ( ) { } public static int bits2words ( long numBits ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } }

Fix:
long endmask = ( ( endIndex & 63 ) == 0 ) ? 0 : ( - 1L ) > > > ( 64 - endIndex ) ;