AspectUtils { @SuppressWarnings("rawtypes") public String toString(Object object) { if (object == null) return "<null>"; else if (object instanceof String) { if (((String) object).length() > 100) return ((String) object).substring(0, 100) + "...[more]"; else return (String) object; } else if (object instanceof Long) return ((Long) object).toString(); else if (object instanceof Boolean) return ((Boolean) object).toString(); else if (object instanceof Double) return ((Double) object).toString(); else if (object instanceof Integer) return ((Integer) object).toString(); else if (object instanceof List) return "items{" + ((List) object).size() + "}"; else { String retVal = getInXMLFormat(object); retVal = (null != retVal && retVal.length() > 0) ? retVal : asTag(object.getClass()); 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 testToString() { @SuppressWarnings("unchecked") List<String> listMock = mock(List.class); assertNotNull(sut.toString(null)); assertNotNull(sut.toString(new Long(10))); assertNotNull(sut.toString(new Boolean(true))); assertNotNull(sut.toString(new Double(2))); assertNotNull(sut.toString(new Integer(2))); assertNotNull(sut.toString(listMock)); }