### Question:
SpanAdapter { static Status toStatusProto(SpanData.Status status) { StatusCode protoStatusCode = StatusCode.STATUS_CODE_OK; if (status.getCanonicalCode() == StatusCanonicalCode.ERROR) { protoStatusCode = StatusCode.STATUS_CODE_UNKNOWN_ERROR; } Status.Builder builder = Status.newBuilder().setCode(protoStatusCode); if (status.getDescription() != null) { builder.setMessage(status.getDescription()); } return builder.build(); } private  SpanAdapter();   }### Answer:
@Test void toProtoStatus() { assertThat(SpanAdapter.toStatusProto(SpanData.Status.unset())) .isEqualTo(Status.newBuilder().setCode(STATUS_CODE_OK).build()); assertThat( SpanAdapter.toStatusProto(SpanData.Status.create(StatusCanonicalCode.ERROR, "ERROR"))) .isEqualTo( Status.newBuilder().setCode(STATUS_CODE_UNKNOWN_ERROR).setMessage("ERROR").build()); assertThat( SpanAdapter.toStatusProto(SpanData.Status.create(StatusCanonicalCode.ERROR, "UNKNOWN"))) .isEqualTo( Status.newBuilder().setCode(STATUS_CODE_UNKNOWN_ERROR).setMessage("UNKNOWN").build()); assertThat( SpanAdapter.toStatusProto( SpanData.Status.create(StatusCanonicalCode.OK, "OK_OVERRIDE"))) .isEqualTo(Status.newBuilder().setCode(STATUS_CODE_OK).setMessage("OK_OVERRIDE").build()); }