CardinalityHLLStatistics extends AbstractCardinalityStatistics<CardinalityHLLStatistics> { public void merge(CardinalityHLLStatistics other) throws CardinalityMergeException { this.hyperLogLog.addAll(other.hyperLogLog); super.count += other.count; }  HyperLogLog getHyperLogLog(); void setHyperLogLog(HyperLogLog hyperLogLog2); long getDistinctCount(); void add(Object colObj); void merge(CardinalityHLLStatistics other);  }
@Test(expected = ClassCastException.class) public void testDifferentTypeMerge() throws CardinalityMergeException { AbstractCardinalityStatistics stat1 = new CardinalityStatistics(); stat1.merge(cardHLLStats); }