question: private String inverseRename ( String renamedFilename , Map < String , String > renamedToReferenceMap ) { List < String > renamedAllParts = FILE_SEP_SPLITTER . splitToList ( renamedFilename ) ; for ( int i = renamedAllParts . size ( ) ; i > 0 ; i -- ) { String renamedParts = FILE_SEP_JOINER . join ( renamedAllParts . subList ( 0 , i ) ) ; String partsToSubstitute = renamedToReferenceMap . get ( renamedParts ) ; if ( partsToSubstitute != null ) { return renamedFilename . replace ( renamedParts , partsToSubstitute ) ; } } return renamedFilename ; }
target:  Walks backwards through the dir prefixes of renamedFilename looking for a match in renamedToReferenceMap.