@Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof Counter) {
            final Counter other = (Counter) obj;
            return Objects.equals(this.total, other.total) &&
                    Objects.equals(this.start, other.start) &&
                    Objects.equals(this.end, other.end);
        }
        return false;
    }
@Test
    public void equals() {
        long start = 100L;
        long total = 300L;
        long end = 200L;
        Counter tt = new Counter(start, total, end);
        Counter same = new Counter(start, total, end);
        Counter diff = new Counter(300L, 700L, 400L);
        new EqualsTester()
                .addEqualityGroup(tt, same)
                .addEqualityGroup(400)
                .addEqualityGroup("")
                .addEqualityGroup(diff)
                .testEquals();

    }