LocalRepository { public File resolve(Artifact artifact) throws IOException { File file = new File(repository, relativePath(artifact)); return file.exists() ? file : null; } LocalRepository();  LocalRepository(File repo); static String relativePath(Artifact artifact); File resolve(Artifact artifact);  }
@Test public void testResolveJar() throws Exception { LocalRepository repo = new LocalRepository(); File jar = repo.resolve(new Artifact("junit", "junit", "4.10")); assertNotNull("file found in repository", jar); }
@Test public void testUnresolvableArtifact() throws Exception { LocalRepository repo = new LocalRepository(); File jar = repo.resolve(new Artifact("com.example", "example", "1.2.3")); assertNull("artifact should not be in repository", jar); }