### Question:
WebConfigurator extends XMLBean { @SuppressWarnings("rawtypes") public boolean setTransportGuarantee(String policy) { boolean modified = false; Namespace namespace = getRootElement().getNamespace(); List constraints = getRootElement().getChildren("security-constraint", namespace); for (Iterator iterator = constraints.iterator(); iterator.hasNext();) { Element constraint = (Element) iterator.next(); if (constraint == null) continue; Element userData = constraint.getChild("user-data-constraint", namespace); if (userData == null) continue; Element transport = userData.getChild("transport-guarantee", namespace); if (transport == null) continue; if (!transport.getText().equals(policy)) { transport.setText(policy); modified = true; } } if (modified) writeXMLDoc(); return modified; } WebConfigurator(String path); void addContextParam(String name, String value, String description, INIT_PARAM append); void addFilterInitParam(String filterName, String param_name, String param_value); void addFilterInitParam(String filterName, String name, String value, String description,
			INIT_PARAM append); void addInitParam(String servletName, String name, String value, String description,
			INIT_PARAM append); void addListenerInitParam(String listenerClazz, String name, String value, INIT_PARAM append); void addInitParam(String servletName, String name, String value, String description); void addServlet(String name, String clazz); @SuppressWarnings("unchecked") void addServlet(String name, String clazz, int loadOnStartup); @SuppressWarnings("unchecked") void addFilter(String name, String clazz); @SuppressWarnings("unchecked") void addListener(String clazz); @SuppressWarnings("unchecked") void addServletMapping(String servlet, String pattern); @SuppressWarnings("unchecked") void addFilterMapping(String filter, String pattern); void setDisplayName(String displayName); String getDisplayName(); void setDescription(String description); @SuppressWarnings("rawtypes") boolean setTransportGuarantee(String policy);  }### Answer:
@Test public void testSetTransportGuarantee() { WebConfigurator config = new WebConfigurator(webXml.getPath()); Assert.assertTrue(config.setTransportGuarantee("CONFIDENCIAL")); Assert.assertFalse(config.setTransportGuarantee("CONFIDENCIAL")); }