private Map < URI , URI > filterConflictingCopyTo ( final Map < URI , URI > copyTo , final Collection < FileInfo > fileInfos ) { final Set < URI > fileinfoTargets = fileInfos . stream ( ) . filter ( fi -> fi . src . equals ( fi . result ) ) . map ( fi -> fi . result ) . collect ( Collectors . toSet ( ) ) ; return copyTo . entrySet ( ) . stream ( ) . filter ( e -> ! fileinfoTargets . contains ( e . getKey ( ) ) ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue ) ) ; }
Filter copy - to where target is used directly .