### Question:
SituationExchangeResource { Siri generateSiriResponse(Date time, List<SituationExchangeDeliveriesStructure> sxDeliveries) { Siri siri = new Siri(); ServiceDelivery serviceDelivery = new ServiceDelivery(); siri.setServiceDelivery(serviceDelivery); List<SituationExchangeDeliveryStructure> list = serviceDelivery.getSituationExchangeDelivery(); SituationExchangeDeliveryStructure sxDeliveryStructure = new SituationExchangeDeliveryStructure(); Situations situations = new Situations(); List<PtSituationElementStructure> list2 = situations.getPtSituationElement(); PtSituationElementStructure ptSituationElementStructure = new PtSituationElementStructure(); list2.add(ptSituationElementStructure); DefaultedTextStructure detailText = new DefaultedTextStructure(); detailText.setLang("EN"); detailText.setValue("frobby morph"); ptSituationElementStructure.setDetail(detailText); sxDeliveryStructure.setSituations(situations); list.add(sxDeliveryStructure); return siri; } SituationExchangeResource(); @GET Response handleGet(); @POST @Produces("application/xml") @Consumes("application/xml") Response handlePost(String body); Response handleRequest(String body); NycSiriService getNycSiriService(); void setNycSiriService(NycSiriService _siriService); void setEnvironment(NycEnvironment environment);  }### Answer:
@Test public void testGenerateSiriResponse() throws JAXBException { Date time = new Date(); List<SituationExchangeDeliveriesStructure> sxDeliveries = new ArrayList<SituationExchangeDeliveriesStructure>(); Siri siri = generateSiriResponse(time, sxDeliveries); Writer writer = marshalToWriter(siri); dumpWriterToSyserr(writer); String result = writer.toString(); assertTrue(result.matches("(?s).*<ServiceDelivery>.*" + "<SituationExchangeDelivery>.*" + "<Situations>.*" + "<PtSituationElement>.*" + "<Detail xml:lang=\"EN\">frobby morph</Detail>.*")); }