CompassDirEntryCache implements DirEntryCache { @Override public int getSize() { final CompassTemplate template = new CompassTemplate(compass); return template.execute(new CompassCallback<Integer>() { public Integer doInCompass(final CompassSession session) { final CompassHits compassHits = session.queryBuilder().matchAll().hits(); return compassHits.length(); } }); } CompassDirEntryCache(final File cacheRootDirectory);  CompassDirEntryCache(final File cacheDirectory, final boolean useDiskStore); @Override void init(); @Override void shutdown(); @Override void setLatestCachedRevisionNumber(final long revision); @Override long getLatestCachedRevisionNumber(); @Override int getSize(); @Override void add(final DirEntry... entries); @Override void clear(); @Override void removeFile(final String pathAndName); @Override void update(final Map<String, DirEntry.Kind> entriesToDelete,
                     final List<DirEntry> entriesToAdd); @Override void removeDirectory(final String pathAndName); @Override List<DirEntry> findEntries(final String searchString, final String startPath); @Override List<DirEntry> findEntriesByCamelCasePattern(final CamelCasePattern camelCasePattern,
                                                      final String startPath); @Override List<DirEntry> findDirectories(final String startPath); @Override void flush(); void setMaxEntriesPerCommit(final int maxEntriesPerCommit);  }
@Test public void testEntryCacheAdd() throws Exception { assertEquals(0, entryCache.getSize()); addAll(entryCache, TestUtils.getDirectoryList()); assertEquals(13, entryCache.getSize()); }