MultiFileModelCache implements PersistentModelCache<T> { @Override public T tryGetModel(PersistentModelKey modelKey) throws IOException { Path cacheFilePath = getCacheFilePath(modelKey, getMD5()); return modelPersister.tryLoadModel(cacheFilePath); } MultiFileModelCache(
            PersistentModelStore<T> modelPersister,
            Function<? super T, ? extends PersistentModelKey> modelKeyFactory); @Override T tryGetModel(PersistentModelKey modelKey); @Override void saveGradleModels(Collection<? extends T> models);  }
@Test public void testGetNonExistant() throws Exception { MemPersistentModelStore<TestModel> persister = new MemPersistentModelStore<>(); MultiFileModelCache<TestModel> cache = getTestCache(persister); TestModel model = cache.tryGetModel(getKey("TestRoot", "TestSub")); assertNull(model); }