List<User> list1 = new ArrayList();
User user = new User("1001","abc1","12",12);
User user1 = new User("1003","abc2","12",13);
User user2 = new User("1002","abc3","12",15);
User user3 = new User("1005","abc4","12",10);
User user4 = new User(null,"abc5","12",10);
list1.add(user);
list1.add(user1);
list1.add(user2);
list1.add(user3);
list1.add(user4);
list1.sort(Comparator.comparing(User::getSiteCode,Comparator.nullsLast(Comparator.naturalOrder())));
list1.forEach(System.out::println);
User(siteCode=1001, userName=abc1, password=12, age=12)
User(siteCode=1002, userName=abc3, password=12, age=15)
User(siteCode=1003, userName=abc2, password=12, age=13)
User(siteCode=1005, userName=abc4, password=12, age=10)
User(siteCode=null, userName=abc5, password=12, age=10)