### Question:
LocalizationBundleJaxrsService { @Resource(name = "bundlePathsList") public void setBundleNames(List<String> bundlePathsList) { bundleNames = new ArrayList<String>(bundlePathsList.size()); for (String bundlePath : bundlePathsList) { bundleNames.add(bundlePath.substring(bundlePath.lastIndexOf(Folder.SEPARATOR) + Folder.SEPARATOR_LENGTH)); } }  @Resource(name = "bundlePathsList") void setBundleNames(List<String> bundlePathsList); @GET @Produces(MediaType.APPLICATION_JSON) Response getBundles(@QueryParam(RestConstants.QUERY_PARAM_EXPANDED) Boolean expanded,
                               @Context HttpHeaders headers, @Context Request request, @Context HttpServletRequest httpRequest); @GET @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) Response getBundle(@PathParam("name") String bundleName, @Context HttpHeaders headers, @Context Request request); byte[] toJson(Map<String, String> messages);  }### Answer:
@Test public void setBundleNames() { final List<String> bundlePathsList = new ArrayList<String>(); bundlePathsList.add("/bundles/" + BUNDLE1_NAME); bundlePathsList.add("/bundles/" + BUNDLE2_NAME); bundlePathsList.add("/bundles/" + BUNDLE3_NAME); bundlePathsList.add("/bundles/" + BUNDLE4_NAME); service.setBundleNames(bundlePathsList); final List<String> bundleNames = service.bundleNames; assertNotNull(bundleNames); assertEquals(bundleNames.size(), bundlePathsList.size()); assertTrue(bundleNames.contains(BUNDLE1_NAME)); assertTrue(bundleNames.contains(BUNDLE2_NAME)); assertTrue(bundleNames.contains(BUNDLE3_NAME)); assertTrue(bundleNames.contains(BUNDLE4_NAME)); }