Buggy code:
TrieMap_5Bits . CompactMapNode < K , V > updated ( final AtomicReference < Thread > mutator , final K key , final V val , final int keyHash , final int shift , final TrieMap_5Bits . MapResult < K , V > details , final Comparator < Object > cmp ) { } TrieMap_5Bits . CompactMapNode < K , V > removed ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieMap_5Bits . MapResult < K , V > details ) { } TrieMap_5Bits . CompactMapNode < K , V > removed ( final AtomicReference < Thread > mutator , final K key , final int keyHash , final int shift , final TrieMap_5Bits . MapResult < K , V > details , final Comparator < Object > cmp ) { } static byte recoverMask ( int map , byte i_th ) { } @ Override public String toString ( ) { } } protected static abstract class CompactMixedMapNode < K , V > extends TrieMap_5Bits . CompactMapNode < K , V > { private final int nodeMap ; private final int dataMap ; CompactMixedMapNode ( final AtomicReference < Thread > mutator , final int nodeMap , final int dataMap ) { } @ Override public int nodeMap ( ) { } @ Override public int dataMap ( ) { } } private static final class BitmapIndexedMapNode < K , V > extends TrieMap_5Bits . CompactMixedMapNode < K , V > { final AtomicReference < Thread > mutator ; final Object [ ] nodes ; private BitmapIndexedMapNode ( final AtomicReference < Thread > mutator , final int nodeMap , final int dataMap , final Object [ ] nodes ) { } @ SuppressWarnings ( "unchecked" ) @ Override K getKey ( final int index ) { } @ SuppressWarnings ( "unchecked" ) @ Override V getValue ( final int index ) { } Map . Entry < K , V > getKeyValueEntry ( final int index ) { } @ SuppressWarnings ( "unchecked" ) @ Override TrieMap_5Bits . CompactMapNode < K , V > 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 TrieMap_5Bits . CompactMapNode < K , V > copyAndSetValue ( final AtomicReference < Thread > mutator , final int bitpos , final V val ) { } @ Override TrieMap_5Bits . CompactMapNode < K , V > copyAndSetNode ( final AtomicReference < Thread > mutator , final int bitpos , final TrieMap_5Bits . CompactMapNode < K , V > node ) { } @ Override TrieMap_5Bits . CompactMapNode < K , V > copyAndInsertValue ( final AtomicReference < Thread > mutator , final int bitpos , final K key , final V val ) { } @ Override TrieMap_5Bits . CompactMapNode < K , V > copyAndRemoveValue ( final AtomicReference < Thread > mutator , final int bitpos ) { } @ Override TrieMap_5Bits . CompactMapNode < K , V > copyAndMigrateFromInlineToNode ( final AtomicReference < Thread > mutator , final int bitpos , final TrieMap_5Bits . CompactMapNode < K , V > node ) { } @ Override TrieMap_5Bits . CompactMapNode < K , V > copyAndMigrateFromNodeToInline ( final AtomicReference < Thread > mutator , final int bitpos , final TrieMap_5Bits . CompactMapNode < K , V > 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 ) + 2 ] ; assert idxOld >= idxNew ; System . arraycopy ( src , 0 , dst , 0 , idxNew ) ; dst [ ( idxNew + 0 ) ] = node . getKey ( 0 ) ; dst [ ( idxNew + 1 ) ] = node . getValue ( 0 ) ; System . arraycopy ( src , idxNew , dst , ( idxNew + 2 ) , ( idxOld - idxNew ) ) ; System . arraycopy ( src , ( idxOld + 1 ) , dst , ( idxOld + 2 ) , ( ( ( src . length ) - idxOld ) - 1 ) ) ; return TrieMap_5Bits . CompactMapNode . nodeOf ( mutator , ( ( int ) ( ( nodeMap ( ) ) ^ bitpos ) ) , ( ( int ) ( ( dataMap ( ) ) | bitpos ) ) , dst ) ; } } private static final class HashCollisionMapNode_5Bits < K , V > extends TrieMap_5Bits . CompactMapNode < K , V > { private final K [ ] keys ; private final V [ ] vals ; private final int hash ; HashCollisionMapNode_5Bits ( final int hash , final K [ ] keys , final V [ ] vals ) { } boolean containsKey ( final K key , final int keyHash , final int shift ) { } boolean containsKey ( final K key , final int keyHash , final int shift , final Comparator < Object > cmp ) { } TrieMap_5Bits . Optional < V > findByKey ( final K key , final int keyHash , final int shift ) { }

Fix:
final int idxNew = ( TrieMap_5Bits . AbstractMapNode . TUPLE_LENGTH ) * ( dataIndex ( bitpos ) ) ;