public static void removeIndexData ( ValidationData data , ValidationDataIndex index ) { String key = index . getKey ( data ) ; List < ValidationData > datas = index . get ( key ) ; if ( ! datas . isEmpty ( ) ) { datas = datas . stream ( ) . filter ( d -> ! d . getId ( ) . equals ( data . getId ( ) ) ) . collect ( Collectors . toList ( ) ) ; } if ( datas . isEmpty ( ) ) { index . getMap ( ) . remove ( key ) ; } else { index . getMap ( ) . put ( key , datas ) ; } }
Remove index data .