@Override public CachedGraphRoadModel build(DependencyProvider dependencyProvider) { return new CachedGraphRoadModel(getGraph(), this); }
@Test public void cacheTest() { if (model instanceof CachedGraphRoadModel) { final Table<Point, Point, List<Point>> cache = HashBasedTable.create(); final List<Point> cachePath = Arrays.asList(SW, NE); cache.put(SW, NE, cachePath); ((CachedGraphRoadModel) model).setPathCache(cache); final List<Point> shortPath = model.getShortestPathTo(SW, NE); assertEquals(shortPath, cachePath); assertEquals(cache, ((CachedGraphRoadModel) model).getPathCache()); } }