### Question:
CredentialsCacheBean { @GET @Path("/listMatching") @Produces({"text/plain", "application/xml", "text/xml", "application/json", "text/html"}) @JmxManaged public DnList listDNsMatching(@QueryParam("substring") final String substr) { DnList result; if (!cachedDatawaveUserServiceInstance.isUnsatisfied()) { result = new DnList(cachedDatawaveUserServiceInstance.get().listMatching(substr)); } else { Set<Principal> principals = authManager.getCachedKeys(); Set<DatawaveUserInfo> userList = principals.parallelStream() .filter(p -> p instanceof DatawavePrincipal) .flatMap(p -> ((DatawavePrincipal) p).getProxiedUsers().stream()) .filter(u -> u.getName().contains(substr)) .map(DatawaveUserInfo::new) .collect(Collectors.toSet()); result = new DnList(userList); } return result; }  @GET @Path("/flushAll") @JmxManaged String flushAll(); @GET @Path("/{dn}/evict") @Produces({"text/plain"}) @JmxManaged String evict(@PathParam("dn") String dn); @GET @Path("/listDNs") @Produces({"text/plain", "application/xml", "text/xml", "application/json", "text/html"}) @JmxManaged DnList listDNs(@QueryParam("localOnly") boolean localOnly); @GET @Path("/listMatching") @Produces({"text/plain", "application/xml", "text/xml", "application/json", "text/html"}) @JmxManaged DnList listDNsMatching(@QueryParam("substring") final String substr); @GET @Path("/{dn}/list") @Produces({"text/plain", "application/xml", "text/xml", "application/json", "text/html"}) @JmxManaged DatawaveUser list(@PathParam("dn") String dn); @SuppressWarnings("unused") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) // transactions not supported directly by this bean void onConfigurationUpdate(@Observes ConfigurationEvent event); @SuppressWarnings("unused") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void onRefreshComplete(@Observes RefreshLifecycle refreshLifecycle); @GET @Path("/listAccumuloAuths") @Produces({"text/plain", "application/json"}) @JmxManaged Set<String> getAccumuloUserAuths(); @GET @Path("/reloadAccumuloAuths") @Produces({"application/xml", "text/xml", "application/json"}) GenericResponse<String> reloadAccumuloAuthorizations();  }### Answer:
@Test public void testListMatching() throws Exception { ArrayList<String> expectedDns = Lists.newArrayList("server1<issuer1>", "user1<issuer1>"); DnList dnList = ccb.listDNsMatching("issuer1"); assertEquals(2, dnList.getDns().size()); assertEquals(expectedDns, new ArrayList<>(dnList.getDns())); }