### Question:
AnonymousModule implements MatchingModule { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final AnonymousModule that = (AnonymousModule) o; final List<String> thisCopy = new ArrayList<>(patternLiterals); final List<String> thatCopy = new ArrayList<>(that.patternLiterals); thisCopy.sort(String::compareTo); thatCopy.sort(String::compareTo); return Objects.equals(thisCopy, thatCopy); } AnonymousModule(Stream<String> patternLiteral); static Optional<AnonymousModule> make(String... globs); static Optional<AnonymousModule> make(List<String> globs); boolean contains(ElementName elementName); @Override boolean equals(Object o); @Override int hashCode(); final List<String> patternLiterals; }### Answer:
@Test @DisplayName("equals should work on the pattern literals") void testEquals() { assertThat(AnonymousModule.make("a", "b")).isEqualTo(AnonymousModule.make("a", "b")); assertThat(AnonymousModule.make("a")).isNotEqualTo(AnonymousModule.make("b")); }