### Question:
LinkFactoryProvider { public LinkFactory registerLinkFactory(final LinkType linkType, final LinkFactory linkFactory) { Objects.requireNonNull(linkType, "linkType must not be null"); Objects.requireNonNull(linkFactory, "linkFactory must not be null"); return this.linkFactories.put(linkType, linkFactory); } LinkFactoryProvider();  LinkFactoryProvider(final Map<LinkType, LinkFactory> linkFactories); LinkFactory getLinkFactory(final LinkType linkType); LinkFactory registerLinkFactory(final LinkType linkType, final LinkFactory linkFactory);  }### Answer:
@Test(expected = NullPointerException.class) public void registerLinkFactoryWithNullLinkType() { try { linkFactoryProvider.registerLinkFactory(null, linkFactoryMock); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("linkType must not be null"); throw e; } }
@Test(expected = NullPointerException.class) public void registerLinkFactoryWithNullLinkFactory() { try { linkFactoryProvider.registerLinkFactory(TEST_LINK_TYPE, null); } catch (NullPointerException e) { assertThat(e.getMessage()).isEqualTo("linkFactory must not be null"); throw e; } }