### Question:
ComposerFormatAttributesExtractor extends ComponentSupport { @VisibleForTesting void extractAuthorPart(final Map<String, Object> author, final List<String> parts, final String key, final String format) { Object part = author.get(key); if (part instanceof String) { parts.add(String.format(format, part)); } } @Inject  ComposerFormatAttributesExtractor(final ComposerJsonExtractor composerJsonExtractor); void extractFromZip(final TempBlob tempBlob, final NestedAttributesMap formatAttributes);  }### Answer:
@Test public void extractAuthorPartMissing() { List<String> parts = new ArrayList<>(); underTest.extractAuthorPart(emptyMap(), parts, "part", "%s"); assertThat(parts, is(empty())); }
@Test public void extractAuthorPartNull() { List<String> parts = new ArrayList<>(); underTest.extractAuthorPart(Collections.singletonMap("part", null), parts, "part", "%s"); assertThat(parts, is(empty())); }
@Test public void extractAuthorPartNonStringValue() { List<String> parts = new ArrayList<>(); underTest.extractAuthorPart(Collections.singletonMap("part", Integer.MAX_VALUE), parts, "part", "%s"); assertThat(parts, is(empty())); }
@Test public void extractAuthorPartString() { List<String> parts = new ArrayList<>(); underTest.extractAuthorPart(Collections.singletonMap("part", "value"), parts, "part", "%s"); assertThat(parts, contains("value")); }