question: private Map . Entry < K , V > doRemoveLastEntry ( ) { for ( ; ; ) { Node < K , V > b = findPredecessorOfLast ( ) ; Node < K , V > n = b . next ; if ( n == null ) { if ( b . isBaseHeader ( ) ) return null ; else continue ; } for ( ; ; ) { Node < K , V > f = n . next ; if ( n != b . next ) break ; Object v = n . value ; if ( v == null ) { n . helpDelete ( b , f ) ; break ; } if ( b . value == null || v == n ) break ; if ( f != null ) { b = n ; n = f ; continue ; } if ( ! n . casValue ( v , null ) ) break ; K key = n . key ; if ( ! n . appendMarker ( f ) || ! b . casNext ( n , f ) ) findNode ( key ) ; else { findPredecessor ( key , comparator ) ; if ( head . right == null ) tryReduceLevel ( ) ; } @ SuppressWarnings ( "unchecked" ) V vv = ( V ) v ; return new AbstractMap . SimpleImmutableEntry < K , V > ( key , vv ) ; } } }
target:  Removes last entry; returns its snapshot. Specialized variant of doRemove.