### Question:
Resource implements Comparable<Resource> { public Element getElement(final Document document) { final Element resourceElement = document.createElement("resource"); resourceElement.appendChild(XmlUtils.createTextElement(document, "directory", directory)); if (filtering != null) { resourceElement.appendChild(XmlUtils.createTextElement(document, "filtering", filtering.toString())); } if (!includes.isEmpty()) { final Element includes = DomUtils.createChildElement("includes", resourceElement, document); for (final String include : this.includes) { includes.appendChild(XmlUtils.createTextElement(document, "include", include)); } } return resourceElement; } Resource(final Element resource);  Resource(final String directory, final Boolean filtering);  Resource(final String directory, final Boolean filtering, final Collection<String> includes); int compareTo(final Resource o); @Override boolean equals(final Object obj); String getDirectory(); Element getElement(final Document document); Boolean getFiltering(); List<String> getIncludes(); String getSimpleDescription(); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testGetElement() { final Resource resource = new Resource(DIRECTORY, FILTERING, Arrays.asList(INCLUDE_1, INCLUDE_2)); final Element element = resource.getElement(DOCUMENT_BUILDER.newDocument()); assertXmlEquals(EXPECTED_XML, element); }