public static void filterErrors ( Collection < ? extends RoboconfError > errors , ErrorCode ... errorCodes ) { // No error code to filter? => errorCodes is an empty array (not null) List < ErrorCode > codesToSkip = new ArrayList <> ( ) ; codesToSkip . addAll ( Arrays . asList ( errorCodes ) ) ; Collection < RoboconfError > toRemove = new ArrayList <> ( ) ; for ( RoboconfError error : errors ) { if ( codesToSkip . contains ( error . getErrorCode ( ) ) ) toRemove . add ( error ) ; } errors . removeAll ( toRemove ) ; }
Filters errors by removing those associated with specific error codes .