public static Map loadYamlFromResource(String resource) {

        InputStream yamlConfig = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);

        Yaml yaml = new Yaml();
        Map mainYamlMap = (Map) yaml.load(yamlConfig);

        Map resultYamlMap = new HashMap();

        List<Map> imports = (List<Map>) mainYamlMap.get("imports");

        if (imports != null) {
            for (Map map : imports) {
                System.out.println(map.get("resource"));
                Map<String, Object> localYamlMap = loadYamlFromResource((String) map.get("resource"));

                resultYamlMap = updateMap(resultYamlMap, localYamlMap);
            }
        }

        resultYamlMap = updateMap(resultYamlMap, mainYamlMap);

        return resultYamlMap;

    }