ClasspathCache { synchronized ImmutableList<UiAnalyzedMethod> getAnalyzedMethods(String className) { updateCache(); Set<UiAnalyzedMethod> analyzedMethods = Sets.newHashSet(); Collection<Location> locations = classNameLocations.get(className); for (Location location : locations) { try { analyzedMethods.addAll(getAnalyzedMethods(location, className)); } catch (IOException e) { logger.warn(e.getMessage(), e); } } if (instrumentation != null) { for (Class<?> clazz : instrumentation.getAllLoadedClasses()) { if (clazz.getName().equals(className)) { analyzedMethods.addAll(getAnalyzedMethods(clazz)); } } } return ImmutableList.copyOf(analyzedMethods); } ClasspathCache(AnalyzedWorld analyzedWorld, @Nullable Instrumentation instrumentation);   }
@Test public void shouldAnalyzedMethods() { List<UiAnalyzedMethod> methods = classpathCache.getAnalyzedMethods(A.class.getName()); assertThat(methods).hasSize(1); }
@Test public void shouldAnalyzedMethodsB() { List<UiAnalyzedMethod> methods = classpathCache.getAnalyzedMethods(B.class.getName()); assertThat(methods).hasSize(1); }