@Test
public void testCoverageFilter() throws IOException, SAXException {

    // build filter
    String input = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[292864,6845440],[292864,6781952],[393216,6781952],[393216,6845440],[292864,6845440]]]},\"properties\":{\"area\":\"Alue ei saa muodostaa silmukkaa. Piirrä risteämätön alue nähdäksesi mittaustuloksen.\"},\"id\":\"drawFeature3\"}],\"crs\":\"EPSG:3067\"}";
    Filter filter = createGeometryFilter(input);
    String request = org.oskari.csw.request.GetRecords.createRequest(filter);
    // read expected result and compare
    String expected = IOHelper.readString(getClass().getResourceAsStream("GetRecords-coverage.xml"));
    Diff xmlDiff = new Diff(request, expected);
    //for getting detailed differences between two xml files
    DetailedDiff detailXmlDiff = new DetailedDiff(xmlDiff);
    List<Difference> differences = detailXmlDiff.getAllDifferences();
    boolean isJava11 = System.getProperty("java.version").startsWith("11.");
    if (isJava11 && differences.size() == 1) {
        // Java 11 produces different results for transforms than Java 8
        // The expected result is produced with Java 8
        // if the only thing that's different is the content of coordinates everything is fine
        final String coordinatesPath =
                "/GetRecords[1]/Query[1]/Constraint[1]/Filter[1]/Intersects[1]/Polygon[1]/outerBoundaryIs[1]/LinearRing[1]/coordinates[1]/text()[1]";
        // if the difference is NOT the coordinates -> we have a problem
        assertEquals("Something else than coordinates transform differ in expected and result",
                coordinatesPath, differences.get(0).getTestNodeDetail().getXpathLocation());
    } else {
        assertTrue("Should get expected coverage request" + xmlDiff, xmlDiff.similar());
    }
}