SerializerException extends IOException implements Stringable { @Override public String asString() { if (methodName != null) { return "Error in " + methodName + "(): " + getMessage(); } else { return "Error: " + getMessage(); } } SerializerException(String format, Object... args);  SerializerException(Throwable cause, String format, Object... args);  SerializerException(SerializerException cause); String getMethodName(); PServiceCallType getCallType(); int getSequenceNo(); PApplicationExceptionType getExceptionType(); SerializerException setMethodName(String methodName); SerializerException setCallType(PServiceCallType callType); SerializerException setSequenceNo(int sequenceNo); SerializerException setExceptionType(PApplicationExceptionType type); @Override String toString(); @Override String asString();  }
@Test public void testAsString() { assertThat(new SerializerException("Message").asString(), is("Error: Message")); assertThat(new SerializerException("Message").setMethodName("foo") .setCallType(PServiceCallType.CALL) .setSequenceNo(123) .asString(), is("Error in foo(): Message")); }