Buggy code:
TrieSet_5Bits . Optional < K > findByKey ( final K key , final int keyHash , final int shift ) { } TrieSet_5Bits . Optional < K > findByKey ( final K key , final int keyHash , final int shift , final Comparator < Object > cmp ) { } TrieSet_5Bits . CompactSetNode < K > updated ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieSet_5Bits . SetResult < K > details ) { } TrieSet_5Bits . CompactSetNode < K > updated ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieSet_5Bits . SetResult < K > details , final Comparator < Object > cmp ) { } TrieSet_5Bits . CompactSetNode < K > removed ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieSet_5Bits . SetResult < K > details ) { } TrieSet_5Bits . CompactSetNode < K > removed ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieSet_5Bits . SetResult < K > details , final Comparator < Object > cmp ) { } static byte recoverMask ( int map , byte i_th ) { } @ Override public String toString ( ) { } } protected static abstract class CompactMixedSetNode < K > extends TrieSet_5Bits . CompactSetNode < K > { private final int nodeMap ; private final int dataMap ; CompactMixedSetNode ( final AtomicReference < Thread > mutator , final int nodeMap , final int dataMap ) { } @ Override public int nodeMap ( ) { } @ Override public int dataMap ( ) { } } private static final class BitmapIndexedSetNode < K > extends TrieSet_5Bits . CompactMixedSetNode < K > { final AtomicReference < Thread > mutator ; final Object [ ] nodes ; private BitmapIndexedSetNode ( final AtomicReference < Thread > mutator , final int nodeMap , final int dataMap , final Object [ ] nodes ) { } @ SuppressWarnings ( "unchecked" ) @ Override K getKey ( final int index ) { } @ SuppressWarnings ( "unchecked" ) @ Override TrieSet_5Bits . CompactSetNode < K > getNode ( final int index ) { } @ Override boolean hasPayload ( ) { } @ Override int payloadArity ( ) { } @ Override boolean hasNodes ( ) { } @ Override int nodeArity ( ) { } @ Override Object getSlot ( final int index ) { } @ Override boolean hasSlots ( ) { } @ Override int slotArity ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( final Object other ) { } @ Override byte sizePredicate ( ) { } @ Override TrieSet_5Bits . CompactSetNode < K > copyAndSetNode ( final AtomicReference < Thread > mutator , final int bitpos , final TrieSet_5Bits . CompactSetNode < K > node ) { } @ Override TrieSet_5Bits . CompactSetNode < K > copyAndInsertValue ( final AtomicReference < Thread > mutator , final int bitpos , final K key ) { } @ Override TrieSet_5Bits . CompactSetNode < K > copyAndRemoveValue ( final AtomicReference < Thread > mutator , final int bitpos ) { } @ Override TrieSet_5Bits . CompactSetNode < K > copyAndMigrateFromInlineToNode ( final AtomicReference < Thread > mutator , final int bitpos , final TrieSet_5Bits . CompactSetNode < K > node ) { } @ Override TrieSet_5Bits . CompactSetNode < K > copyAndMigrateFromNodeToInline ( final AtomicReference < Thread > mutator , final int bitpos , final TrieSet_5Bits . CompactSetNode < K > node ) { final int idxOld = ( ( this . nodes . length ) - 1 ) - ( nodeIndex ( bitpos ) ) ; <START_BUG> final int idxNew = dataIndex ( bitpos ) ; <END_BUG> final Object [ ] src = this . nodes ; final Object [ ] dst = new Object [ ( ( src . length ) - 1 ) + 1 ] ; assert idxOld >= idxNew ; System . arraycopy ( src , 0 , dst , 0 , idxNew ) ; dst [ ( idxNew + 0 ) ] = node . getKey ( 0 ) ; System . arraycopy ( src , idxNew , dst , ( idxNew + 1 ) , ( idxOld - idxNew ) ) ; System . arraycopy ( src , ( idxOld + 1 ) , dst , ( idxOld + 1 ) , ( ( ( src . length ) - idxOld ) - 1 ) ) ; return TrieSet_5Bits . CompactSetNode . nodeOf ( mutator , ( ( int ) ( ( nodeMap ( ) ) ^ bitpos ) ) , ( ( int ) ( ( dataMap ( ) ) | bitpos ) ) , dst ) ; } } private static final class HashCollisionSetNode_5Bits < K > extends TrieSet_5Bits . CompactSetNode < K > { private final K [ ] keys ; private final int hash ; HashCollisionSetNode_5Bits ( final int hash , final K [ ] keys ) { } boolean contains ( final K key , final int keyHash , final int shift ) { } boolean contains ( final K key , final int keyHash , final int shift , final Comparator < Object > cmp ) { } TrieSet_5Bits . Optional < K > findByKey ( final K key , final int keyHash , final int shift ) { } TrieSet_5Bits . Optional < K > findByKey ( final K key , final int keyHash , final int shift , final Comparator < Object > cmp ) { }

Fix:
final int idxNew = ( TrieSet_5Bits . AbstractSetNode . TUPLE_LENGTH ) * ( dataIndex ( bitpos ) ) ;