@Test public void testIsEmpty() { Message msg = new Message(null, null); if (!msg.isEmpty()) { fail("should be empty"); } HashMap<String, String> header = new HashMap<String, String>(10); msg = new Message(header, null); if (!msg.isEmpty()) { fail("should be empty"); } byte[] data = {}; msg = new Message(header, data); if (!msg.isEmpty()) { fail("should be empty"); } byte[] d = {1,2,3}; msg = new Message(header, d); if (msg.isEmpty()) { fail("should not be empty"); } }
public boolean isEmpty() { if (this.header != null) { if (this.header.size() > 0) { return false; } } if (this.body != null) { if (this.body.length > 0) { return false; } } return true; }
Message implements Serializable { public boolean isEmpty() { if (this.header != null) { if (this.header.size() > 0) { return false; } } if (this.body != null) { if (this.body.length > 0) { return false; } } return true; } }
Message implements Serializable { public boolean isEmpty() { if (this.header != null) { if (this.header.size() > 0) { return false; } } if (this.body != null) { if (this.body.length > 0) { return false; } } return true; } Message();  Message(Map<String, String> header, byte[] body); }
Message implements Serializable { public boolean isEmpty() { if (this.header != null) { if (this.header.size() > 0) { return false; } } if (this.body != null) { if (this.body.length > 0) { return false; } } return true; } Message();  Message(Map<String, String> header, byte[] body); Map<String, String> getHeader(); String get(String key); void put(String key, String value); void put(byte[] body); byte[] getBody(); boolean isEmpty(); boolean equals(Message msg); }
Message implements Serializable { public boolean isEmpty() { if (this.header != null) { if (this.header.size() > 0) { return false; } } if (this.body != null) { if (this.body.length > 0) { return false; } } return true; } Message();  Message(Map<String, String> header, byte[] body); Map<String, String> getHeader(); String get(String key); void put(String key, String value); void put(byte[] body); byte[] getBody(); boolean isEmpty(); boolean equals(Message msg);  }