### Question:
CachesResource { @GET public List<Cache> getCaches() { LOG.debug("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return cacheList; }  @Path("{cache}") CacheResource getCacheResource(@PathParam("cache") String cache); @GET List<Cache> getCaches();  }### Answer:
@Test public void testGetCaches() throws Exception { HttpURLConnection result = HttpUtil.get("http: assertEquals(200, result.getResponseCode()); DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = documentBuilder.parse(result.getInputStream()); XPath xpath = XPathFactory.newInstance().newXPath(); String cacheCount = xpath.evaluate("count( assertTrue(Integer.parseInt(cacheCount) >= 6); }