IPv4RangeFileParser { public List<String> parse() { logger.info("load ip range file, classpath={}", classpath); try (InputStream stream = ClasspathResources.stream(classpath); var reader = new BufferedReader(new InputStreamReader(stream, UTF_8))) { return reader.lines() .filter(line -> !line.isBlank() && line.charAt(0) != '#') .collect(Collectors.toList()); } catch (IOException e) { throw new UncheckedIOException(e); } } IPv4RangeFileParser(String classpath); List<String> parse();  }
@Test void parse() { List<String> cidrs = parser.parse(); assertThat(cidrs).hasSize(12).contains("104.44.236.208/30"); }