📅  最后修改于: 2022-03-11 14:52:37.588000             🧑  作者: Mango
public static Set getKeyByValue(Map map, E value) {
return map.entrySet()
.stream()
.filter(entry -> Objects.equals(entry.getValue(), value))
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
}