Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void close() {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (o instanceof HistogramUnionState == false) return false;

HistogramUnionState that = (HistogramUnionState) o;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ public void testWriteToReadRoundTripPreservesBehavior() throws IOException {
}
}

public void testEmptySingletonWriteToReadRoundTripEquals() throws IOException {
BytesStreamOutput out = new BytesStreamOutput();
HistogramUnionState.EMPTY.writeTo(out);

try (HistogramUnionState roundTripped = HistogramUnionState.read(breaker(), out.bytes().streamInput())) {
assertThat(roundTripped, equalTo(HistogramUnionState.EMPTY));
assertThat(HistogramUnionState.EMPTY, equalTo(roundTripped));
assertThat(roundTripped.hashCode(), equalTo(HistogramUnionState.EMPTY.hashCode()));
}
}

public void testPureTDigestSerializationCompatibility() throws IOException {
try (RandomState state = randomState(false)) {

Expand Down
Loading