### Question:
HostAllowlistUtils { static boolean hostIsInAllowlist(final List<String> allowlist, final String hostHeader) { return allowlist.stream() .anyMatch(allowlistEntry -> allowlistEntry.toLowerCase().equals(hostHeader.toLowerCase())); }    }### Answer:
@Test public void hostIsInAllowlist_shouldBeTrueIfInList() { assertThat(hostIsInAllowlist(List.of("A", "B"), "A")).isTrue(); assertThat(hostIsInAllowlist(List.of("A", "B"), "B")).isTrue(); assertThat(hostIsInAllowlist(List.of("A", "MIXed.CASE"), "miXED.caSE")).isTrue(); }
@Test public void hostIsInAllowlist_shouldBeFalseIfNotInList() { assertThat(hostIsInAllowlist(List.of("A", "B"), "C")).isFalse(); assertThat(hostIsInAllowlist(List.of("A", "B"), "AA")).isFalse(); assertThat(hostIsInAllowlist(List.of("A.B.C", "B"), "A")).isFalse(); }