package com.tuoheng.admin;

import com.tuoheng.common.core.utils.JsonResult;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Test {

    public static void main(String[] args) throws ParseException {

    }

    private static void buildMap(Map<String, Object> map) {
       map.put("a", 1);
       map.put("b", 2);
    }

    private static List<String> buildList2() {
        List<String> list2 = new ArrayList<>();
        list2.add("b");
        list2.add("e");
        list2.add("d");
        return list2;
    }

    private static List<String> jiao(List<String> oldList, List<String> newList) {
        // 交集
        oldList.retainAll(newList);
        System.out.println(oldList.toString()); // b
        return oldList;
    }

    private static List<String> bing(List<String> oldList, List<String> newList) {
        // 交集
        oldList.retainAll(newList);
        System.out.println(oldList.toString()); // b

        return oldList;
    }

    private static List<String> cha(List<String> oldList, List<String> newList) {
        // 差集
        oldList.retainAll(newList);
        System.out.println(oldList.toString()); // b

        return oldList;
    }
}
