### Question:
SymbolLookup { public <T> T find(Class<T> type, String symbol) { try { Key k = new Key("find",type,symbol); Object i = cache.get(k); if (i!=null) return type.cast(i); if (!Utilities.isJavaIdentifier(symbol)) return null; checkPluginsForChangeAndRefresh(); Object miss = noHitCache.get(k); if (miss == NO_HIT) { return null; } for (Class<?> e : Index.list(Symbol.class, pluginManager.uberClassLoader, Class.class)) { if (type.isAssignableFrom(e)) { Symbol s = e.getAnnotation(Symbol.class); if (s != null) { for (String t : s.value()) { if (t.equals(symbol)) { i = jenkins.getInjector().getInstance(e); cache.put(k, i); return type.cast(i); } } } } } noHitCache.put(k, NO_HIT); return null; } catch (IOException e) { LOGGER.log(Level.WARNING, "Unable to find @Symbol",e); return null; } }  T find(Class<T> type, String symbol); Descriptor<?> findDescriptor(Class<?> type, String symbol); static SymbolLookup get(); @Nonnull static Set<String> getSymbolValue(@Nonnull Object o); @SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Jenkins.getInstance() can return null in theory.") @Nonnull static Set<String> getSymbolValue(@Nonnull Class<?> c);  }### Answer:
@Test public void test() { assertNull(lookup.find(Object.class, "zoo")); assertThat((Foo) lookup.find(Object.class, "foo"), is(sameInstance(this.foo))); assertThat((Bar) lookup.find(Object.class, "bar"), is(sameInstance(this.bar))); assertNull(lookup.find(String.class, "foo")); }