class PropertiesExt {

    public static List<String> verifyRootNames(Map<String, String> properties, Set<String> expectedRootNames) {
        if (CollectionsExt.isNullOrEmpty(properties)) {
            return Collections.emptyList();
        }
        List<String> notMatching = new ArrayList<>();
        for (String key : properties.keySet()) {
            String name = key.trim();

            int idx = name.indexOf('.');
            String rootPart = (idx == -1 || idx == name.length() - 1)
                    ? name
                    : name.substring(0, idx);

            if (!expectedRootNames.contains(rootPart)) {
                notMatching.add(name);
            }
        }
        return notMatching;
    }

    private  PropertiesExt();

}