Map<String, String> map = new HashMap<>();
// Convert all Map keys to a List
List<String> result = new ArrayList(map.keySet());
// Convert all Map values to a List
List<String> result2 = new ArrayList(map.values());
// Java 8, Convert all Map keys to a List
List<String> result3 = map.keySet().stream()
.collect(Collectors.toList());
// Java 8, Convert all Map values to a List
List<String> result4 = map.values().stream()
.collect(Collectors.toList());
// Java 8, seem a bit long, but you can enjoy the Stream features like filter and etc.
List<String> result5 = map.values().stream()
.filter(x -> !"apple".equalsIgnoreCase(x))
.collect(Collectors.toList());
//list转化成Map
Map<String, Employee> map1 = employeeList.stream()
.collect(toMap(Employee::getName, Function.identity()));
java8之map与list转化Map<String, String> map = new HashMap<>();// Convert all Map keys to a ListList<String> result = new ArrayList(map.keySet());// Convert all Map values to a ListList<String> result2 = new ArrayList(map.values())