@Test public void shouldRenameNamespace() throws Exception { Element childElement = mock(Element.class); when(element.getChildren()).thenReturn(Lists.newArrayList(childElement, childElement)); JdomUtils.replaceNamespace(element, Mockito.any(Namespace.class)); verify(element).setNamespace(Mockito.any(Namespace.class)); verify(childElement, times(2)).setNamespace(Mockito.any(Namespace.class)); }
@SuppressWarnings("unchecked") public static Element replaceNamespace(final Element element, final Namespace namespace) { element.setNamespace(namespace); for (Element child : (List<Element>) element.getChildren()) { replaceNamespace(child, namespace); } return element; }
JdomUtils { @SuppressWarnings("unchecked") public static Element replaceNamespace(final Element element, final Namespace namespace) { element.setNamespace(namespace); for (Element child : (List<Element>) element.getChildren()) { replaceNamespace(child, namespace); } return element; } }
JdomUtils { @SuppressWarnings("unchecked") public static Element replaceNamespace(final Element element, final Namespace namespace) { element.setNamespace(namespace); for (Element child : (List<Element>) element.getChildren()) { replaceNamespace(child, namespace); } return element; } private  JdomUtils(); }
JdomUtils { @SuppressWarnings("unchecked") public static Element replaceNamespace(final Element element, final Namespace namespace) { element.setNamespace(namespace); for (Element child : (List<Element>) element.getChildren()) { replaceNamespace(child, namespace); } return element; } private  JdomUtils(); @SuppressWarnings("unchecked") static Element replaceNamespace(final Element element, final Namespace namespace); static byte[] documentToByteArray(final Document document); static Document inputStreamToDocument(final InputStream stream); }
JdomUtils { @SuppressWarnings("unchecked") public static Element replaceNamespace(final Element element, final Namespace namespace) { element.setNamespace(namespace); for (Element child : (List<Element>) element.getChildren()) { replaceNamespace(child, namespace); } return element; } private  JdomUtils(); @SuppressWarnings("unchecked") static Element replaceNamespace(final Element element, final Namespace namespace); static byte[] documentToByteArray(final Document document); static Document inputStreamToDocument(final InputStream stream);  }