class DefaultAtlasCombineStrategy implements AtlasCombineStrategy {

    protected static Map<Integer, String> sortByKey(Map<Integer, String> map) {
        TreeMap<Integer, String> treeMap = new TreeMap<>((key1, key2) -> {
            if (key1 == null && key2 == null) {
                return 0;
            } else if (key1 == null) {
                return -1;// 1 or -1; whatever, the null value can be retrieved only with .get(null)
            } else if (key2 == null) {
                return 1;
            } else {
                return key1.compareTo(key2);
            }
        });
        treeMap.putAll(map);
        return treeMap;
    }

}