@Test
public void testMarshalUnmarshal() throws Exception {

    String xml = Recode2ColorTest.class.getResource("../../colorRecode.se").getFile();
    Unmarshaller u = org.orbisgis.coremap.map.JaxbContainer.JAXBCONTEXT.createUnmarshaller();
    JAXBElement<StyleType> ftsElem = (JAXBElement<StyleType>) u.unmarshal(
            new FileInputStream(xml));
    Marshaller m = org.orbisgis.coremap.map.JaxbContainer.JAXBCONTEXT.createMarshaller();
    m.marshal(ftsElem, new FileOutputStream("c2routput.se"));
    Style st = new Style(ftsElem, null);
    JAXBElement<StyleType> elem = st.getJAXBElement();
    m.marshal(elem, new FileOutputStream("c2routput.se"));
    //Let's search in the created JAXBElement
    StyleType stype = elem.getValue();
    RuleType rt = stype.getRule().get(0);
    LineSymbolizerType lst = ((LineSymbolizerType)(rt.getSymbolizer().getValue()));
    SolidFillType sf = ((SolidFillType)((PenStrokeType)lst.getStroke().getValue()).getFill().getValue());
    JAXBElement je = (JAXBElement) (sf.getColor().getContent().get(0));
    RecodeType rect = ((RecodeType)(je.getValue()));
    assertTrue(rect.getMapItem().size() == 4);
}