@Test public void testAdd() { LabelCounters c1 = new LabelCounters(); LabelCounters c2 = new LabelCounters(); LabelCounters c3 = new LabelCounters(); c1.setTotalBytes(123L); c1.setTotalMessages(23L); c1.setUnreadMessages(335L); c2.setTotalBytes(223L); c2.setTotalMessages(223L); c2.setUnreadMessages(685L); c3.setTotalBytes(100L); c3.setTotalMessages(200L); c3.setUnreadMessages(350L); c1.add(c3); assertEquals(c1, c2); }
public void add(final LabelCounters diff) { if (diff.totalBytes != null) { this.totalBytes += diff.totalBytes; } if (diff.totalMessages != null) { this.totalMessages += diff.totalMessages; } if (diff.unreadMessages != null) { this.unreadMessages += diff.unreadMessages; } }
LabelCounters { public void add(final LabelCounters diff) { if (diff.totalBytes != null) { this.totalBytes += diff.totalBytes; } if (diff.totalMessages != null) { this.totalMessages += diff.totalMessages; } if (diff.unreadMessages != null) { this.unreadMessages += diff.unreadMessages; } } }
LabelCounters { public void add(final LabelCounters diff) { if (diff.totalBytes != null) { this.totalBytes += diff.totalBytes; } if (diff.totalMessages != null) { this.totalMessages += diff.totalMessages; } if (diff.unreadMessages != null) { this.unreadMessages += diff.unreadMessages; } } LabelCounters();  LabelCounters(LabelCounters l); }
LabelCounters { public void add(final LabelCounters diff) { if (diff.totalBytes != null) { this.totalBytes += diff.totalBytes; } if (diff.totalMessages != null) { this.totalMessages += diff.totalMessages; } if (diff.unreadMessages != null) { this.unreadMessages += diff.unreadMessages; } } LabelCounters();  LabelCounters(LabelCounters l); Long getTotalBytes(); void setTotalBytes(Long totalBytes); Long getTotalMessages(); void setTotalMessages(Long totalMessages); Long getUnreadMessages(); void setUnreadMessages(Long unreadMessages); void add(final LabelCounters diff); LabelCounters getInverse(); @Override boolean equals(Object obj); @Override String toString(); }
LabelCounters { public void add(final LabelCounters diff) { if (diff.totalBytes != null) { this.totalBytes += diff.totalBytes; } if (diff.totalMessages != null) { this.totalMessages += diff.totalMessages; } if (diff.unreadMessages != null) { this.unreadMessages += diff.unreadMessages; } } LabelCounters();  LabelCounters(LabelCounters l); Long getTotalBytes(); void setTotalBytes(Long totalBytes); Long getTotalMessages(); void setTotalMessages(Long totalMessages); Long getUnreadMessages(); void setUnreadMessages(Long unreadMessages); void add(final LabelCounters diff); LabelCounters getInverse(); @Override boolean equals(Object obj); @Override String toString();  }