public PeriodStats plus(PeriodStats toAdd) {
        PeriodStats result = new PeriodStats();

        result.messagesSent += this.messagesSent;
        result.messageSendErrors += this.messageSendErrors;
        result.bytesSent += this.bytesSent;
        result.messagesReceived += this.messagesReceived;
        result.bytesReceived += this.bytesReceived;
        result.totalMessagesSent += this.totalMessagesSent;
        result.totalMessageSendErrors += this.totalMessageSendErrors;
        result.totalMessagesReceived += this.totalMessagesReceived;
        result.publishLatency.add(this.publishLatency);
        result.publishDelayLatency.add(this.publishDelayLatency);
        result.endToEndLatency.add(this.endToEndLatency);

        result.messagesSent += toAdd.messagesSent;
        result.messageSendErrors += toAdd.messageSendErrors;
        result.bytesSent += toAdd.bytesSent;
        result.messagesReceived += toAdd.messagesReceived;
        result.bytesReceived += toAdd.bytesReceived;
        result.totalMessagesSent += toAdd.totalMessagesSent;
        result.totalMessageSendErrors += toAdd.totalMessageSendErrors;
        result.totalMessagesReceived += toAdd.totalMessagesReceived;
        result.publishLatency.add(toAdd.publishLatency);
        result.publishDelayLatency.add(toAdd.publishDelayLatency);
        result.endToEndLatency.add(toAdd.endToEndLatency);

        return result;
    }
@Test
    void zeroPlus() {
        PeriodStats one = new PeriodStats();
        PeriodStats two = new PeriodStats();
        two.messagesSent = 10;
        two.messageSendErrors = 20;
        two.bytesSent = 30;
        two.messagesReceived = 40;
        two.bytesReceived = 50;
        two.totalMessagesSent = 60;
        two.totalMessageSendErrors = 70;
        two.totalMessagesReceived = 80;
        PeriodStats result = one.plus(two);
        assertThat(result)
                .satisfies(
                        r -> {
                            assertThat(r.messagesSent).isEqualTo(10);
                            assertThat(r.messageSendErrors).isEqualTo(20);
                            assertThat(r.bytesSent).isEqualTo(30);
                            assertThat(r.messagesReceived).isEqualTo(40);
                            assertThat(r.bytesReceived).isEqualTo(50);
                            assertThat(r.totalMessagesSent).isEqualTo(60);
                            assertThat(r.totalMessageSendErrors).isEqualTo(70);
                            assertThat(r.totalMessagesReceived).isEqualTo(80);

                            assertThat(r.publishLatency).isEqualTo(two.publishLatency);
                            assertThat(r.publishDelayLatency).isEqualTo(two.publishDelayLatency);
                            assertThat(r.endToEndLatency).isEqualTo(two.endToEndLatency);
                        });
    }