@Test @SuppressWarnings("unchecked") public void get() { List<ThreadsEndpoint.ThreadInfo> infos = (List<ThreadsEndpoint.ThreadInfo>) endpoint.get(); Map<Thread, StackTraceElement[]> threads = ThreadsEndpoint.getAllStackTraces(); Assert.assertEquals(threads.size(), infos.size()); for (Map.Entry<Thread, StackTraceElement[]> entry : threads.entrySet()) { Thread t = entry.getKey(); Optional<ThreadsEndpoint.ThreadInfo> match = infos.stream() .filter(i -> t.getId() == i.getId()) .findFirst(); Assert.assertTrue(match.isPresent()); Assert.assertEquals(t.getName(), match.get().getName()); Assert.assertEquals(t.getPriority(), match.get().getPriority()); } }
@Override public Object get() { return threads(); }
ThreadsEndpoint implements HttpEndpoint { @Override public Object get() { return threads(); } }
ThreadsEndpoint implements HttpEndpoint { @Override public Object get() { return threads(); }  }
ThreadsEndpoint implements HttpEndpoint { @Override public Object get() { return threads(); }  @Override Object get(); @Override Object get(String path); }
ThreadsEndpoint implements HttpEndpoint { @Override public Object get() { return threads(); }  @Override Object get(); @Override Object get(String path);  }