I have map Map<Type, Long> countByType
and I want to have a list which has sorted (min to max) keys by their corresponding values. My try is:
countByType.entrySet().stream().sorted().collect(Collectors.toList());
however this just gives me a list of entries, how can I get a list of types, without losing the order?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…