List<String> menuPathlist = new ArrayList<String>();
List<String> menuIds = menuPathlist.stream().map(line -> line.split("/")).flatMap(Arrays::stream)
.distinct().collect(Collectors.toList());
原文:https://www.cnblogs.com/merseyalma/p/9481109.html