AspectUtils { public String getInXMLFormat(Object object){ String retVal = ""; if(null == marshaller) marshaller = new SimpleMarshallerImpl(); try { retVal = asTag(object.getClass()) + " In XML format : " + marshaller.marshal(object); } catch (SimpleMarshallerException e1) { retVal = asTag(object.getClass()) + " : " + getObjectdetails(object); } return retVal; } AspectUtils();  AspectUtils(SimpleMarshaller marshaller); void beforeMethod(JoinPoint joinPoint); void afterMethod(JoinPoint joinPoint, Object result,
			long lengthMillis); StringBuilder logParamValues(StringBuilder logLine,
			String[] paramNames, Object[] paramValues); @SuppressWarnings("rawtypes") String toString(Object object); SimpleMarshaller getMarshaller(); void setMarshaller(SimpleMarshaller marshaller); String getObjectdetails(Object obj); String getInXMLFormat(Object object);  }
@Test public void testGetInXMLFormat() throws SimpleMarshallerException{ when(marshaller.marshal("StringTest")).thenThrow(new SimpleMarshallerException("test")); sut.getInXMLFormat("StingTest"); }