public static void main(String[] args) { try (var inputStream = Main.class.getClassLoader().getResourceAsStream("application.yml")) { var yamlToProperties = new YamlToProperties(inputStream); Map stringObjectMap = yamlToProperties.asProperties(); stringObjectMap.forEach((key, value) -> { System.out.println("Key: " + key + ", Value: " + value); }); } catch (IOException e) { System.out.println(e.getMessage()); } }