@Test public void testEqualsTwoCopies() { ExperimentCounts otherCounter = new ExperimentCounts.Builder().withJointActionCounts(jointActionCounts) .withImpressionCounts(impressionCounts).withActionCounts(actionCounts) .withBuckets(buckets).build(); assertThat(counter, equalTo(otherCounter.clone())); assertThat(counter, equalTo(otherCounter)); }
@Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; }
ExperimentCounts extends AbstractContainerCounts { @Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; } }
ExperimentCounts extends AbstractContainerCounts { @Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; }  }
ExperimentCounts extends AbstractContainerCounts { @Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; }  @JsonIgnore void addBucketCounts(Bucket.Label bucketLabel, BucketCounts bucketCounts); Map<Bucket.Label, BucketCounts> getBuckets(); void setBuckets(Map<Bucket.Label, BucketCounts> value); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override ExperimentCounts clone(); }
ExperimentCounts extends AbstractContainerCounts { @Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; }  @JsonIgnore void addBucketCounts(Bucket.Label bucketLabel, BucketCounts bucketCounts); Map<Bucket.Label, BucketCounts> getBuckets(); void setBuckets(Map<Bucket.Label, BucketCounts> value); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override ExperimentCounts clone();  }