### Question:
Capsule implements Runnable, InvocationHandler { private Path dependencyToLocalJar(Path jar, String dep, String type, Entry<String, ?> attrContext) { String res = dependencyToLocalJar0(jar, dep, type, attrContext); return res != null ? path(toNativePath(res)) : null; } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); static final void main(String[] args); @SuppressWarnings({"BroadCatchBlock", "UnusedAssignment"}) static int main0(String[] args0); static void premain(String agentArgs, Instrumentation inst); static Object getCapsule(String capletClassName); boolean isAgent(); @Override final void run(); @Override Object invoke(Object proxy, Method method, Object[] args); @Override final int hashCode(); @Override final boolean equals(Object obj); @Override String toString(); static final String VERSION; }### Answer:
@Test public void testDependencyToLocalJar() throws Exception { Path jar = fs.getPath("foo.jar"); String file; file = "lib/com.acme/foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "lib/com.acme-foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "lib/com.acme-foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "lib/com.acme-foo-3.1-big.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1:big", "mmm")); file = "lib/foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "com.acme/foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "com.acme-foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "com.acme-foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); file = "com.acme-foo-3.1-big.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1:big", "mmm")); file = "foo-3.1.mmm"; writeJarWithFile(jar, file); assertEquals(file, dependencyToLocalJar(jar, "com.acme:foo:3.1", "mmm")); }