@Test
public void testFilterErrors() {

	// Original list
	List<RoboconfError> errors = new ArrayList<> ();
	errors.add( new RoboconfError( CMD_CANNOT_HAVE_ANY_PARENT ));
	errors.add( new RoboconfError( RM_ROOT_INSTALLER_MUST_BE_TARGET ));
	errors.add( new RoboconfError( RM_ROOT_INSTALLER_MUST_BE_TARGET ));
	errors.add( new RoboconfError( RM_UNRESOLVABLE_FACET_VARIABLE ));
	errors.add( new RoboconfError( RM_UNREACHABLE_COMPONENT ));
	errors.add( new RoboconfError( RM_ORPHAN_FACET_WITH_CHILDREN ));
	errors.add( new RoboconfError( RM_ORPHAN_FACET ));
	// Remove nothing
	int size = errors.size();
	RoboconfErrorHelpers.filterErrors( errors );
	Assert.assertEquals( size, errors.size());
	// Remove orphan facets codes
	RoboconfErrorHelpers.filterErrors( errors, RM_ORPHAN_FACET );
	Assert.assertEquals( size - 1, errors.size());
	for( RoboconfError error : errors )
		Assert.assertNotEquals( RM_ORPHAN_FACET, error.getErrorCode());
	// Remove "root installer must be target" and "unreachable component" codes
	RoboconfErrorHelpers.filterErrors(
			errors,
			ErrorCode.RM_ROOT_INSTALLER_MUST_BE_TARGET,
			ErrorCode.RM_UNREACHABLE_COMPONENT );
	Assert.assertEquals( size - 4, errors.size());
	for( RoboconfError error : errors ) {
		Assert.assertNotEquals( RM_ORPHAN_FACET, error.getErrorCode());
		Assert.assertNotEquals( RM_ROOT_INSTALLER_MUST_BE_TARGET, error.getErrorCode());
		Assert.assertNotEquals( RM_UNREACHABLE_COMPONENT, error.getErrorCode());
	}
	// Remove something that was not here
	RoboconfErrorHelpers.filterErrors( errors, REC_ARTIFACT_ID_IN_LOWER_CASE );
	Assert.assertEquals( size - 4, errors.size());
}