@Test public void testCompare() { assertEquals(-1, new LocalPriorityComparator().compare(new NullLocal("/t") { @Override public boolean isFile() { return false; } @Override public boolean isDirectory() { return true; } }, new NullLocal("/t") { @Override public boolean isFile() { return true; } @Override public boolean isDirectory() { return false; } })); }
@Override public int compare(final Local o1, final Local o2) { if(o1.isDirectory() && o2.isDirectory()) { return 0; } if(o1.isFile() && o2.isFile()) { return 0; } if(o1.isDirectory()) { return -1; } if(o2.isDirectory()) { return 1; } return 0; }
LocalPriorityComparator implements Comparator<Local> { @Override public int compare(final Local o1, final Local o2) { if(o1.isDirectory() && o2.isDirectory()) { return 0; } if(o1.isFile() && o2.isFile()) { return 0; } if(o1.isDirectory()) { return -1; } if(o2.isDirectory()) { return 1; } return 0; } }
LocalPriorityComparator implements Comparator<Local> { @Override public int compare(final Local o1, final Local o2) { if(o1.isDirectory() && o2.isDirectory()) { return 0; } if(o1.isFile() && o2.isFile()) { return 0; } if(o1.isDirectory()) { return -1; } if(o2.isDirectory()) { return 1; } return 0; }  }
LocalPriorityComparator implements Comparator<Local> { @Override public int compare(final Local o1, final Local o2) { if(o1.isDirectory() && o2.isDirectory()) { return 0; } if(o1.isFile() && o2.isFile()) { return 0; } if(o1.isDirectory()) { return -1; } if(o2.isDirectory()) { return 1; } return 0; }  @Override int compare(final Local o1, final Local o2); }
LocalPriorityComparator implements Comparator<Local> { @Override public int compare(final Local o1, final Local o2) { if(o1.isDirectory() && o2.isDirectory()) { return 0; } if(o1.isFile() && o2.isFile()) { return 0; } if(o1.isDirectory()) { return -1; } if(o2.isDirectory()) { return 1; } return 0; }  @Override int compare(final Local o1, final Local o2);  }