Properties { public void load(String classpath) { try (InputStream stream = ClasspathResources.stream(classpath); var reader = new BufferedReader(new InputStreamReader(stream, UTF_8))) { var properties = new java.util.Properties(); properties.load(reader); properties.forEach((key, value) -> set((String) key, (String) value)); } catch (IOException e) { throw new UncheckedIOException(e); } }  void load(String classpath); Optional<String> get(String key); void set(String key, String value); Set<String> keys(); boolean containsKey(String key);  }
@Test void loadNotExistedFile() { assertThatThrownBy(() -> properties.load("not-existed-property.properties")) .isInstanceOf(Error.class) .hasMessageContaining("can not load"); }