### Question:
ComponentRegistry { public final V get(String instrumentationName) { return get(instrumentationName, null); }  final V get(String instrumentationName); final V get(String instrumentationName, @Nullable String instrumentationVersion); final Collection<V> getComponents(); abstract V newComponent(InstrumentationLibraryInfo instrumentationLibraryInfo);  }### Answer:
@Test void libraryName_MustNotBeNull() { assertThrows(NullPointerException.class, () -> registry.get(null, "version"), "name"); }
@Test void libraryVersion_AllowsNull() { TestComponent testComponent = registry.get(INSTRUMENTATION_NAME, null); assertThat(testComponent).isNotNull(); assertThat(testComponent.instrumentationLibraryInfo.getName()).isEqualTo(INSTRUMENTATION_NAME); assertThat(testComponent.instrumentationLibraryInfo.getVersion()).isNull(); }
@Test void getSameInstanceForSameName_WithoutVersion() { assertThat(registry.get(INSTRUMENTATION_NAME)).isSameAs(registry.get(INSTRUMENTATION_NAME)); assertThat(registry.get(INSTRUMENTATION_NAME)) .isSameAs(registry.get(INSTRUMENTATION_NAME, null)); }
@Test void getSameInstanceForSameName_WithVersion() { assertThat(registry.get(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION)) .isSameAs(registry.get(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION)); }
@Test void getDifferentInstancesForDifferentNames() { assertThat(registry.get(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION)) .isNotSameAs(registry.get(INSTRUMENTATION_NAME + "_2", INSTRUMENTATION_VERSION)); }
@Test void getDifferentInstancesForDifferentVersions() { assertThat(registry.get(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION)) .isNotSameAs(registry.get(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION + "_1")); }