### Question:
AuthOption { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthOption that = (AuthOption) o; if (!type.equals(that.getType())) return false; if (!key.equals(that.getKey())) return false; if (!value.equals(that.getValue())) return false; return urlMatcher.equals(that.getUrlMatcher()); } AuthOption(Type type, String key, String value);  AuthOption(Type type, String key, String value, Predicate<URL> urlMatcher); Type getType(); String getKey(); String getValue(); Predicate<URL> getUrlMatcher(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void paramAuthOption() throws MalformedURLException { URL url = new URL("http: Predicate<URL> urlMatcher = urlPredicate -> urlPredicate.equals(url); AuthOption option1 = new AuthOption(AuthOption.Type.HEADER, "myHeader", "myValue", urlMatcher); AuthOption option2 = new AuthOption(AuthOption.Type.HEADER, "myHeader", "myValue", urlMatcher); assertEquals(option1, option2); Set<AuthOption> options = new HashSet<>(); assertTrue(options.add(option1)); assertFalse(options.add(option2)); }
@Test public void equalsTest() { AuthOption option1 = new AuthOption(AuthOption.Type.HEADER, "myHeader", "myValue"); AuthOption option2 = new AuthOption(AuthOption.Type.HEADER, "myHeader", "myValue"); assertEquals(option1, option1); assertEquals(option1, option2); assertNotEquals(option1, null); assertNotEquals(option1, new Object()); assertNotEquals(option1, new AuthOption(AuthOption.Type.QUERY, "myHeader", "myValue")); assertNotEquals(option1, new AuthOption(AuthOption.Type.HEADER, "myFooHeader", "myValue")); assertNotEquals(option1, new AuthOption(AuthOption.Type.HEADER, "myHeader", "myFooValue")); }