### Question:
ApplicationEhCache extends javax.ws.rs.core.Application { public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.exceptions.WebApplicationExceptionMapper.class); s.add(net.sf.ehcache.management.resource.exceptions.DefaultExceptionMapper.class); s.add(net.sf.ehcache.management.resource.exceptions.ResourceRuntimeExceptionMapper.class); return s; }  Set<Class<?>> getClasses();  }### Answer:
@Test public void testGetClasses() throws Exception { List<String> classpathElements = getClasspathElements(); ApplicationEhCache applicationEhCache = new ApplicationEhCache(); Set<Class<?>> applicationClasses = applicationEhCache.getClasses(); Set<Class<?>> allClassesFound = new HashSet<Class<?>>(); for (String cpElement : classpathElements) { if (cpElement.endsWith(".jar")) { if (pathOfJarNotFiltered(cpElement)) { System.out.println("last scanned path : " + cpElement); allClassesFound.addAll(getAllClassesFromJar(cpElement)); } } else { System.out.println("last scanned path : " + cpElement); allClassesFound.addAll(getAllClassesFromDirectory(cpElement)); } } Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); for (Class<?> aClass : allClassesFound) { if (aClass.isAnnotationPresent(javax.ws.rs.ext.Provider.class) || aClass.isAnnotationPresent(javax.ws.rs.Path.class)) { annotatedClasses.add(aClass); } } Assert.assertThat(annotatedClasses, equalTo(applicationClasses)); }