Java tutorial
//package com.java2s; import java.util.Map; import java.util.Map.Entry; public class Main { public static <T, G> T getByValue(final Map<T, G> map, final G value) { for (final Entry<T, G> entry : map.entrySet()) if (entry.getValue().equals(value)) return entry.getKey(); return null; } }