Buggy code:
public final class ID implements Serializable , Cloneable , Comparable < ID > { private static final long serialVersionUID = 6860626236168125168L ; public static final int kNetworkSizeExpected = 100000 ; public static final int kProviderLimit = 1024 ; public static final int kSemanticPartBitLen = 6 ; public static final int kSemanticTotalBitLen = ( ID . kSemanticPartBitLen ) * ( ServiceId . kPartsSemantic ) ; public static final int kProviderBitLen = ID . ProviderMinimumBitLen ( ) ; public static final int kTotalBitLen = ( ID . kSemanticTotalBitLen ) + ( ID . kProviderBitLen ) ; private static final ID idMin ; private static final ID idMax ; private static int ProviderMinimumBitLen ( ) { } private static double log2 ( double x ) { } public final BitSet id ; private static BitSet hashString ( final String s ) { } private static BitSet bitsetResize ( final BitSet a , final int numBits ) { } private static void partHashSet ( final BitSet dst , final int dstOffset , final BitSet src , final int srcLen ) { <START_BUG> assert ( dstOffset + ( dst . size ( ) ) ) <= srcLen ; <END_BUG> for ( int i = 0 ; i < ( Math . min ( src . size ( ) , srcLen ) ) ; ++ i ) dst . set ( ( dstOffset + i ) , src . get ( i ) ) ; } @ FunctionalInterface interface Fn0 < _R > { public _R apply ( ) { } } @ FunctionalInterface interface Fn1 < A , _R > { public _R apply ( A a ) { } } @ FunctionalInterface interface Fn2 < A , B , _R > { public _R apply ( A a , B b ) { } } @ FunctionalInterface interface Fn3 < A , B , C , _R > { public _R apply ( A a , B b , C c ) { } } private static BitSet hashServiceId ( ServiceId svcId ) { } private static BitSet bitsetArithPwrOf2 ( final BitSet _bs , final int pwrOf2 , final boolean addition ) { } protected static BitSet bitsetSubPwrOf2 ( final BitSet _bs , final int pwrOf2 ) { } protected static BitSet bitsetAddPwrOf2 ( final BitSet _bs , final int pwrOf2 ) { } public static class IdSpan { public static final ID . IdSpan kEmpty = new ID . IdSpan ( Optional . empty ( ) ) ; public static final ID . IdSpan kAll = ID . IdSpan . Inclusive ( ID . idMin , ID . idMax ) ; public static ID . IdSpan Inclusive ( final ID bgn , final ID end ) { } public boolean empty ( ) { } @ Override public String toString ( ) { } public boolean contains ( final ID x ) { } public boolean containsExcl ( ID x ) { } public ID bgn ( ) { } public ID end ( ) { } public ID . IdSpan subsetMin ( final ID newMin ) { } private static class SpanInclusive { public final ID bgn ; public final ID end ; SpanInclusive ( ID _bgn , ID _end ) { } } private final Optional < ID . IdSpan . SpanInclusive > span ; private IdSpan ( Optional < ID . IdSpan . SpanInclusive > s ) { } } public static ID . IdSpan ServiceId ( ServiceId svcId ) { } public static ID NodeId ( final byte [ ] blob ) { } public ID ( ProviderId x ) { } private ID ( ) { } private ID ( BitSet x ) { } @ Override public ID clone ( ) { } public final String toString ( ) { } public final String toHexString ( int numberOfBytes ) { } public final String toHexString ( ) { } public final int getLength ( ) { } public final ID addPowerOfTwo ( final int powerOfTwo ) { } public final boolean equals ( Object equalsTo ) { } public final int compareTo ( ID otherKey ) throws ClassCastException { } public final int hashCode ( ) { } public boolean isInInterval ( ID a , ID b ) { } No newline ; at end ; of file ; }

Fix:
assert ( dstOffset + srcLen ) <= ( dst . size ( ) ) ;