### Question:
HtmlLanguageBuilder { public HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName) { requireNonNull(spanType, "Must provide a spanType"); requireNonNull(alternativeTagName, "Must provide an alternativeTagName"); spanTypeToElementNameSubstitution.put(spanType, alternativeTagName); return this; } HtmlLanguageBuilder(); HtmlLanguageBuilder name(String name); HtmlLanguageBuilder add(BlockType blockType); HtmlLanguageBuilder add(SpanType spanType); HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName); HtmlLanguageBuilder addHeadings(int level); HtmlLanguageBuilder addSpanFont(); HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict); HtmlLanguageBuilder document(String prefix, String suffix); HtmlLanguageBuilder setSupportsImages(boolean supportsImages); HtmlLanguage create();  }### Answer:
@Test public void addSpanSubstitutionNullAlternative() { NullPointerException npe = assertThrows(NullPointerException.class, () -> builder.addSubstitution(SpanType.BOLD, (String) null)); assertTrue(npe.getMessage().contains("Must provide an alternativeTagName")); }
@Test public void addSpanSubstitutionNullSpanType() { NullPointerException npe = assertThrows(NullPointerException.class, () -> builder.addSubstitution((SpanType) null, "bold")); assertTrue(npe.getMessage().contains("Must provide a spanType")); }
@Test public void addSpanSubstitution() { assertNotNull(builder.addSubstitution(SpanType.BOLD, "bold")); assertSame(builder, builder.addSubstitution(SpanType.BOLD, "bold")); }