keyset to list code example Example: keyset to list List<String> keys = new ArrayList<>(uniqueRecs.keySet());