ClassPathInit { @PostConstruct public void init() { final String systemClasspath = System.getProperty("java.class.path", StringUtils.EMPTY); for (String pathEntry : systemClasspath.split(File.pathSeparator)) { final File parentFile = ObjectUtils.defaultIfNull(new File(pathEntry).getParentFile(), new File(".")); final Collection<File> childrenFileList = FileUtils.listFiles(parentFile, new String[]{"jar"}, false); for (File candidate : childrenFileList) { final String name = candidate.getName(); if (name.startsWith("grinder-dcr-agent") && (name.contains("javadoc") || name.contains("source"))) { if (!candidate.delete()) { LOGGER.error("Failed to delete grinder-dcr-agent-javadoc and source"); } } } } }  @PostConstruct void init();  }
@Test public void testClassPathInit() { ClassPathInit classPathInit = new ClassPathInit(); classPathInit.init(); String agent = getAgent(); assertThat(agent, not(containsString("javadoc"))); assertThat(agent, not(containsString("sources"))); }