public User getUserEntryFromIdKey(String id) {
for (Map.Entry<Integer, User> entry : userMap.entrySet()) {
if (entry.getKey().matches(id)) {
return entry.getValue();
}
}
return null;
}
Efficient way to iterate map value with more than 50K records.