Map implementations are allowed to contain null mappings. If you called motherChildIndex.put(personId, null) and then called motherChildIndex.getOrDefault(personId, Collections.emptySet()), it would return null, not an empt set.