Java tutorial
//package com.java2s; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; public class Main { public static <T1, T2> T2 getHashMapElementByHash(ConcurrentHashMap<T1, T2> target, int hashcode) { Iterator<T1> iter = target.keySet().iterator(); Object key = null; while (iter.hasNext()) { key = iter.next(); if (key.hashCode() == hashcode) { return target.get(key); } } return null; } }