多个list取交集 @param lists @return
(List... lists)
| 554 | * @return |
| 555 | */ |
| 556 | public static List<String> getListIntersection(List... lists){ |
| 557 | if(ObjectUtils.isEmpty(lists)){ |
| 558 | return new ArrayList(); |
| 559 | } |
| 560 | List<List> dataList = new ArrayList(Arrays.asList(lists)); |
| 561 | List<String> intersectionList = dataList.get(0); |
| 562 | for (List data : dataList){ |
| 563 | if(ObjectUtils.isEmpty(data)){ |
| 564 | return new ArrayList(); |
| 565 | } |
| 566 | intersectionList = intersectionList.stream().filter(item -> data.contains(item)).collect(toList()); |
| 567 | } |
| 568 | return intersectionList; |
| 569 | } |
| 570 | |
| 571 | /** |
| 572 | * 获取服务器ip |
nothing calls this directly
no outgoing calls
no test coverage detected