Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { public static <T> boolean removeByValue(Map<?, T> map, T value) { for (Map.Entry<?, T> o : map.entrySet()) { if (o.getValue() == value) { map.remove(o.getKey()); return true; } } return false; } }