Set<String> () { Set<String> blackList = new HashSet<>(); URL url = InspectionProfileEntry.class.getResource("inspection-black-list.txt"); if (url == null) { LOG.error("Resource not found"); return blackList; } try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty()) { blackList.add(line); } } } catch (IOException e) { LOG.error("Unable to load resource: " + url, e); } return Collections.unmodifiableSet(blackList); }