LocalIndexDir implements Comparable<LocalIndexDir> { public boolean isEmpty() { String[] listing = dir.list(); if (listing == null) { return false; } return listing.length == 1; } LocalIndexDir(File dir); long size(); boolean isEmpty(); String getJcrPath(); String getFSPath(); @Override int compareTo(LocalIndexDir o); @Override String toString();  }
@Test public void nonEmptyDir() throws Exception{ IndexMeta m = new IndexMeta("/a/b", 100); File baseDir = createDirWithIndexMetaFile(m); new File(baseDir, "foo").mkdir(); LocalIndexDir dir = new LocalIndexDir(baseDir); assertFalse(dir.isEmpty()); }