@Test public void testCompare() throws Exception { Company one = new Company("champion", "a"); Company two = new Company("commander", "b"); Company three = new Company("warrior", "c"); Company four = new Company("warrior", "b"); assertEquals(-1, presenter.compare(one, two)); assertEquals(1, presenter.compare(three, two)); assertEquals(1, presenter.compare(three, four)); assertEquals(-1, presenter.compare(four, three)); assertEquals(0, presenter.compare(four, four)); assertEquals(0, presenter.compare(four, four)); }
@Override public int compare(Company lhs, Company rhs) { if (lhs.getLevel() != rhs.getLevel()) return lhs.getLevel() - rhs.getLevel(); return lhs.getName().compareTo(rhs.getName()); }
CompanyPresenter extends RxPresenter<CompanyView, ArrayList<Company>> implements Comparator<Company> { @Override public int compare(Company lhs, Company rhs) { if (lhs.getLevel() != rhs.getLevel()) return lhs.getLevel() - rhs.getLevel(); return lhs.getName().compareTo(rhs.getName()); } }
CompanyPresenter extends RxPresenter<CompanyView, ArrayList<Company>> implements Comparator<Company> { @Override public int compare(Company lhs, Company rhs) { if (lhs.getLevel() != rhs.getLevel()) return lhs.getLevel() - rhs.getLevel(); return lhs.getName().compareTo(rhs.getName()); }  }
CompanyPresenter extends RxPresenter<CompanyView, ArrayList<Company>> implements Comparator<Company> { @Override public int compare(Company lhs, Company rhs) { if (lhs.getLevel() != rhs.getLevel()) return lhs.getLevel() - rhs.getLevel(); return lhs.getName().compareTo(rhs.getName()); }  void loadCompanies(); @Override int compare(Company lhs, Company rhs); }
CompanyPresenter extends RxPresenter<CompanyView, ArrayList<Company>> implements Comparator<Company> { @Override public int compare(Company lhs, Company rhs) { if (lhs.getLevel() != rhs.getLevel()) return lhs.getLevel() - rhs.getLevel(); return lhs.getName().compareTo(rhs.getName()); }  void loadCompanies(); @Override int compare(Company lhs, Company rhs);  }