class PropertiesExt {

    public static Set<String> getRootNames(Collection<String> names, int rootSegments) {
        // Split nested field names
        Set<String> topNames = new HashSet<>();
        names.forEach(n -> {
            Pair<String, String> parts = split(n, rootSegments);
            if (parts != null) {
                topNames.add(parts.getLeft());
            }
        });
        return topNames;
    }

    private  PropertiesExt();

}