@Test public void testToString() { Message msg = MESSAGE_REGISTRY.createMessage("InvalidMessage"); msg.setArgument("messageName", "FooBar"); msg.setArgument("messageID", (short) -255); String expected = "Message 0 InvalidMessage"; String actual = msg.toString(); Assert.assertEquals(actual, expected, "Invalid message expected, not received."); }
@Override public String toString() { return "Message " + id + ' ' + name; }
Message { @Override public String toString() { return "Message " + id + ' ' + name; } }
Message { @Override public String toString() { return "Message " + id + ' ' + name; } Message(MessageType type, Object... args);   Message(MessageType messageType); }
Message { @Override public String toString() { return "Message " + id + ' ' + name; } Message(MessageType type, Object... args);   Message(MessageType messageType); static Class getTypeForName(String name); void setArgument(String argumentName, Object argument); Object getArgument(String argumentName); short getID(); final Object[] getArgs(); @Override String toString(); }
Message { @Override public String toString() { return "Message " + id + ' ' + name; } Message(MessageType type, Object... args);   Message(MessageType messageType); static Class getTypeForName(String name); void setArgument(String argumentName, Object argument); Object getArgument(String argumentName); short getID(); final Object[] getArgs(); @Override String toString(); final String name; }