### Question:
CommonAdapter { static InstrumentationLibrary toProtoInstrumentationLibrary( InstrumentationLibraryInfo instrumentationLibraryInfo) { return InstrumentationLibrary.newBuilder() .setName(instrumentationLibraryInfo.getName()) .setVersion( instrumentationLibraryInfo.getVersion() == null ? "" : instrumentationLibraryInfo.getVersion()) .build(); } private  CommonAdapter(); @SuppressWarnings("unchecked") static KeyValue toProtoAttribute(AttributeKey<T> key, T value);  }### Answer:
@Test void toProtoInstrumentationLibrary() { InstrumentationLibrary instrumentationLibrary = CommonAdapter.toProtoInstrumentationLibrary( InstrumentationLibraryInfo.create("name", "version")); assertThat(instrumentationLibrary.getName()).isEqualTo("name"); assertThat(instrumentationLibrary.getVersion()).isEqualTo("version"); }
@Test void toProtoInstrumentationLibrary_NoVersion() { InstrumentationLibrary instrumentationLibrary = CommonAdapter.toProtoInstrumentationLibrary( InstrumentationLibraryInfo.create("name", null)); assertThat(instrumentationLibrary.getName()).isEqualTo("name"); assertThat(instrumentationLibrary.getVersion()).isEmpty(); }