借鉴了
https://www.cnblogs.com/exmyth/p/11012873.html
https://blog.csdn.net/fengfengchen95/article/details/102621844
有一个对象集合 List<AdminMedia> adminMediaList
取得对象集合中的Path字段作为新的List
List<String> pathList = adminMediaList.stream().map(AdminMedia -> AdminMedia.getPath()).collect(Collectors.toMap());
取得对象中的path和ename字段作为一个map
Map <String,String> map= adminMediaList.stream().collect(Collectors.toMap(AdminMedia::getPath, AdminMedia::getEname));