### Question:
JavadocShortcutUriProcessor implements UriProcessor { @Override public String process(String uri) { String newUri = preprocessUri(uri); if (!newUri.equals(uri)) { newUri = prependWithBasePackage(newUri); if (SourceVersion.isName(newUri)) { if (isPotentialPackageName(newUri)) { return toPackagePage(newUri); } return toTypePage(newUri); } } return uri; } JavadocShortcutUriProcessor(String javadocRelativePath, String basePackageName); @Override String process(String uri); @Override String target(String uri);  }### Answer:
@Test public void processAnyUri() { assertEquals("", processor.process("")); assertEquals("foo", processor.process("foo")); assertEquals("some/path/foo.html", processor.process("some/path/foo.html")); }
@Test public void processPackageName() { assertEquals("../index.html?foo/package-summary.html", processor.process("@foo")); assertEquals("../index.html?foo/bar/package-summary.html", processor.process("@foo.bar")); }
@Test public void processAbsoluteUriPackageName() { assertEquals("../index.html?foo/package-summary.html", processor.process("javadoc: }
@Test public void processPackageNameWithBasePackage() { assertEquals("../index.html?org/eclipse/mylyn/wikitext/foo/package-summary.html", processor.process("@.foo")); assertEquals("../index.html?org/eclipse/mylyn/wikitext/foo/bar/package-summary.html", processor.process("@.foo.bar")); }
@Test public void processTypeName() { assertEquals("../index.html?Foo.html", processor.process("@Foo")); assertEquals("../index.html?foo/Bar.html", processor.process("@foo.Bar")); }
@Test public void processAbsoluteUriTypeName() { assertEquals("../index.html?Foo.html", processor.process("javadoc: }
@Test public void processTypeNameWithBasePackage() { assertEquals("../index.html?org/eclipse/mylyn/wikitext/Foo.html", processor.process("@.Foo")); assertEquals("../index.html?org/eclipse/mylyn/wikitext/foo/Bar.html", processor.process("@.foo.Bar")); }
@Test public void processMalformedName() { assertEquals("@foo-bar", processor.process("@foo-bar")); }