@Test public void test() { r.example(); }
void example() { List<Company> companies = new ArrayList<>(); companies.add(new Company("Washington", 2)); companies.add(new Company("Washington", 1)); companies.add(new Company("Washington", 4)); companies.add(new Company("China", 3)); Collections.sort(companies, comparator); for (Company company : companies) { _log.debug(company.toString()); } System.out.println("------------------------------------"); List<Company> result = removeDuplicateUsers(companies, 1); System.out.println("------------------------------------"); for (Company company : result) { _log.debug(company.toString()); } }
RemoveDuplicateAndSort { void example() { List<Company> companies = new ArrayList<>(); companies.add(new Company("Washington", 2)); companies.add(new Company("Washington", 1)); companies.add(new Company("Washington", 4)); companies.add(new Company("China", 3)); Collections.sort(companies, comparator); for (Company company : companies) { _log.debug(company.toString()); } System.out.println("------------------------------------"); List<Company> result = removeDuplicateUsers(companies, 1); System.out.println("------------------------------------"); for (Company company : result) { _log.debug(company.toString()); } } }
RemoveDuplicateAndSort { void example() { List<Company> companies = new ArrayList<>(); companies.add(new Company("Washington", 2)); companies.add(new Company("Washington", 1)); companies.add(new Company("Washington", 4)); companies.add(new Company("China", 3)); Collections.sort(companies, comparator); for (Company company : companies) { _log.debug(company.toString()); } System.out.println("------------------------------------"); List<Company> result = removeDuplicateUsers(companies, 1); System.out.println("------------------------------------"); for (Company company : result) { _log.debug(company.toString()); } }  }
RemoveDuplicateAndSort { void example() { List<Company> companies = new ArrayList<>(); companies.add(new Company("Washington", 2)); companies.add(new Company("Washington", 1)); companies.add(new Company("Washington", 4)); companies.add(new Company("China", 3)); Collections.sort(companies, comparator); for (Company company : companies) { _log.debug(company.toString()); } System.out.println("------------------------------------"); List<Company> result = removeDuplicateUsers(companies, 1); System.out.println("------------------------------------"); for (Company company : result) { _log.debug(company.toString()); } }   }
RemoveDuplicateAndSort { void example() { List<Company> companies = new ArrayList<>(); companies.add(new Company("Washington", 2)); companies.add(new Company("Washington", 1)); companies.add(new Company("Washington", 4)); companies.add(new Company("China", 3)); Collections.sort(companies, comparator); for (Company company : companies) { _log.debug(company.toString()); } System.out.println("------------------------------------"); List<Company> result = removeDuplicateUsers(companies, 1); System.out.println("------------------------------------"); for (Company company : result) { _log.debug(company.toString()); } }    }