@Test
public void createEnhancedFilterTest() throws IOException {

    String expectedXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<filter>\n"
            + "  <repositories>\n"
            + "    <repository>\n"
            + "      <id>ThisIsId</id>\n"
            + "      <filenames>\n"
            + "        <includes>\n"
            + "          <include>*</include>\n"
            + "        </includes>\n"
            + "        <excludes>\n"
            + "          <exclude>*.doc</exclude>\n"
            + "        </excludes>\n"
            + "      </filenames>\n"
            + "      <paths>\n"
            + "        <includes>\n"
            + "          <include>*</include>\n"
            + "        </includes>\n"
            + "        <excludes>\n"
            + "          <exclude>/tags/*</exclude>\n"
            + "        </excludes>\n"
            + "      </paths>\n"
            + "      <properties>\n"
            + "        <includes>\n"
            + "          <include>*</include>\n"
            + "        </includes>\n"
            + "        <excludes>\n"
            + "          <exclude>svm:*</exclude>\n"
            + "        </excludes>\n"
            + "      </properties>\n"
            + "    </repository>\n"
            + "  </repositories>\n"
            + "</filter>\n";
    Repository repos = new Repository();
    IncludeExcludeList includeList = new IncludeExcludeList();
    includeList.addInclude("*");
    includeList.addExclude("*.doc");
    repos.setId("ThisIsId");
    repos.setFilenames(includeList);
    IncludeExcludeList il = new IncludeExcludeList();
    il.addInclude("*");
    il.addExclude("/tags/*");
    repos.setPaths(il);
    il = new IncludeExcludeList();
    il.addInclude("*");
    il.addExclude("svm:*");
    repos.setProperties(il);
    Repositories repositories = new Repositories();
    repositories.addRepository(repos);
    Filter filter = new Filter();
    filter.setRepositories(repositories);
    assertEquals(FilterFile.toString(filter), expectedXML);
}