class ScenarioExtractorUtil {

    public static List<String> extractWrongFunctionalityIds(String scenarioName, Collection<Functionality> functionalities) {
        List<String> wrongIds = new ArrayList<>();
        for (final String rawMaybeId : maybeIds(scenarioName)) {
            String maybeId = rawMaybeId.trim();
            try {
                Long longId = Long.valueOf(maybeId);
                if (functionalities.stream().noneMatch(f -> longId.equals(f.getId()))) {
                    wrongIds.add(maybeId);
                }
            } catch (final NumberFormatException e) {
                wrongIds.add(maybeId);
            }
        }
        return wrongIds;
    }

}