### Question:
HWModule implements MatchingModule { public static Optional<HWModule> make(String moduleName, String... globs) { return make(moduleName, Arrays.asList(globs)); } private  HWModule(String name, AnonymousModule anonymousModule); static Optional<HWModule> make(String moduleName, String... globs); static Optional<HWModule> make(String moduleName, List<String> globs); boolean contains(ElementName elementName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final String name; }### Answer:
@Test @DisplayName("equals should work on the pattern literals") void testEqualsGlobs() { assertThat(HWModule.make(NAME, "a", "b")).isEqualTo(HWModule.make(NAME, "a", "b")); assertThat(HWModule.make(NAME, "a")).isNotEqualTo(HWModule.make(NAME, "b")); }
@Test @DisplayName("equals should work on the module name") void testEqualsName() { assertThat(HWModule.make(NAME, "a", "b")).isNotEqualTo(HWModule.make("otherName", "a", "b")); }
@Test @DisplayName("equals should work on the pattern literals in different order") void testEqualsGlobOrder() { assertThat(HWModule.make(NAME, "a", "b")).isEqualTo(HWModule.make(NAME, "b", "a")); }
@TestFactory @DisplayName("contains") public List<DynamicTest> containsAnonymous() { return AnonymousModuleTest.containsTests(globs -> HWModule.make(NAME, globs)); }
@TestFactory @DisplayName("make") public List<DynamicTest> makeAnonymous() { return AnonymousModuleTest.makeTests(globs -> HWModule.make(NAME, globs)); }