### Question:
CustomXStreamHandler extends XStreamHandler { public String fromObjectTest(Object obj, String resultCode, Writer out) throws IOException { if (obj != null) { XStream xstream = this.createTestXStream(); xstream.toXML(obj, out); } return null; }  String fromObjectTest(Object obj, String resultCode, Writer out); void toObjectTest(Reader in, Object target);  }### Answer:
@Test public void testFromObject() throws IOException { EntryWithReferencesBean<ArrivalAndDepartureV2Bean> response = new HandlerTestHelper().createTestObject(); Writer writer = new StringWriter(); fromObjectTest(response, "arg1", writer); writer.close(); assertEquals(expected, writer.toString().replaceAll("\n", "")); }