public synchronized Indicators filter(final boolean includeLocationAgnostic,
                                          final ErrorType... includedErrorTypes) {

        if (includedErrorTypes == null || includedErrorTypes.length == 0) {
            return new Indicators(this);
        } else {
            final Set<ErrorType> includedErrorTypesSet = ErrorType.asSet(includedErrorTypes);
            final Predicate<StoredError> locationPredicate = includeLocationAgnostic
                    ? err -> true
                    : err -> err.getLocation() != null
                            && err.getLocation().getLineNo() > 0
                            && err.getLocation().getColNo() > 0;

            final List<StoredError> filteredErrors = NullSafe.list(errorList)
                    .stream()
                    .filter(storedError ->
                            includedErrorTypesSet.contains(storedError.getErrorType()))
                    .filter(locationPredicate)
                    .collect(Collectors.toList());

            if (errorList.size() == filteredErrors.size()) {
                return new Indicators(this);
            } else {
                final Indicators indicators = new Indicators();
                indicators.addAll(filteredErrors);
                return indicators;
            }
        }
    }
@return A new {@link Indicators} instance containing only those {@link StoredError}s
matching the supplied types
stroom-util-shared/src/main/java/stroom/util/shared/Indicators.java