### Question:
Renderer { private boolean validateParent(GadgetContext context) { String container = context.getContainer(); String parent = context.getParameter("parent"); if (parent == null) { return true; } List<Object> parents = containerConfig.getList(container, "gadgets.parent"); if (parents.isEmpty()) { return true; } for (Object pattern : parents) { if (Pattern.matches(pattern.toString(), parent)) { return true; } } return false; } @Inject  Renderer(Processor processor,
                  HtmlRenderer renderer,
                  ContainerConfig containerConfig,
                  LockedDomainService lockedDomainService); RenderingResults render(GadgetContext context);  }### Answer:
@Test public void validateParent() throws Exception { containerConfig.data.put("gadgets.parent", Arrays.asList("http:\\/\\/example\\.org\\/[a-z]+", "localhost")); RenderingResults results = renderer.render(makeContext("html")); assertEquals(RenderingResults.Status.OK, results.getStatus()); }