Collector { @Override public String toString() { return getClass().getSimpleName() + "[application=" + getApplication() + ", periodMillis=" + periodMillis + ", counters=" + getCounters() + ']'; } Collector(String application, List<Counter> counters);  Collector(String application, List<Counter> counters,
			SamplingProfiler samplingProfiler); String getApplication(); SamplingProfiler getSamplingProfiler(); List<SampledMethod> getHotspots(); Map<String, Date> getDatesByWebappVersions(); List<Counter> getCounters(); Counter getCounterByName(String counterName); Counter getCounterByRequestId(CounterRequest request); List<CounterRequestContext> getRootCurrentContexts(List<Counter> newParentCounters); long getLastCollectDuration(); Throwable getLastCollectorException(); long getEstimatedMemorySize(); long getDiskUsage(); List<Counter> getRangeCounters(Range range); List<Counter> getRangeCountersToBeDisplayed(Range range); Counter getRangeCounter(Range range, String counterName); void collectLocalContextWithoutErrors(); void collectWithoutErrors(List<JavaInformations> javaInformationsList); JRobin getJRobin(String graphName); Collection<JRobin> getCounterJRobins(); Collection<JRobin> getDisplayedCounterJRobins(); Collection<JRobin> getDisplayedOtherJRobins(); boolean isStorageUsedByMultipleInstances(); void stop(); boolean isStopped(); static void stopJRobin(); static void detachVirtualMachine(); @Override String toString();  }
@Test public void testToString() throws SchedulerException { final Collector collector = createCollectorWithOneCounter(); assertToStringNotEmpty("collector", collector); assertToStringNotEmpty("java", new JavaInformations(null, false)); assertToStringNotEmpty("thread", new ThreadInformations(Thread.currentThread(), Arrays.asList(Thread.currentThread().getStackTrace()), 100, 1000, false, Parameters.getHostAddress())); assertToStringNotEmpty("session", new SessionInformations(new SessionTestImpl(true), true)); assertToStringNotEmpty("memory", new MemoryInformations()); CacheManager.getInstance().addCache("testToString"); try { assertToStringNotEmpty("cache", new CacheInformations( CacheManager.getInstance().getEhcache("testToString"), false)); } finally { CacheManager.getInstance().shutdown(); } final MutableConfiguration<Object, Object> conf = new MutableConfiguration<Object, Object>(); conf.setManagementEnabled(true); conf.setStatisticsEnabled(true); Caching.getCachingProvider().getCacheManager().createCache("cache", conf); try { assertToStringNotEmpty("cache", new JCacheInformations("cache")); } finally { Caching.getCachingProvider().getCacheManager().close(); } final Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); final JobDetail job = new JobDetail("job", null, JobTestImpl.class); assertToStringNotEmpty("job", new JobInformations(job, null, scheduler)); assertToStringNotEmpty("connectionInfos", new ConnectionInformations()); }