### Question:
AuthScope { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof AuthScope) { final AuthScope that = (AuthScope) obj; return LangUtils.equals(this.protocol, that.protocol) && LangUtils.equals(this.host, that.host) && this.port == that.port && LangUtils.equals(this.realm, that.realm) && LangUtils.equals(toNullSafeLowerCase(this.schemeName), toNullSafeLowerCase(that.schemeName)); } return false; } AuthScope(
            final String protocol,
            final String host,
            final int port,
            final String realm,
            final String schemeName);  AuthScope(
            final HttpHost origin,
            final String realm,
            final String schemeName);  AuthScope(final HttpHost origin);  AuthScope(final String host, final int port);  AuthScope(final AuthScope authScope); String getProtocol(); String getHost(); int getPort(); String getRealm(); String getSchemeName(); int match(final AuthScope that); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { final AuthScope authscope1 = new AuthScope("http", "somehost", 80, "somerealm", "somescheme"); final AuthScope authscope2 = new AuthScope("http", "someotherhost", 80, "somerealm", "somescheme"); final AuthScope authscope3 = new AuthScope("http", "somehost", 80, "somerealm", "somescheme"); final AuthScope authscope4 = new AuthScope("http", "somehost", 8080, "somerealm", "somescheme"); final AuthScope authscope5 = new AuthScope("http", "somehost", 80, "someotherrealm", "somescheme"); final AuthScope authscope6 = new AuthScope("http", "somehost", 80, "somerealm", "someotherscheme"); final AuthScope authscope7 = new AuthScope("https", "somehost", 80, "somerealm", "somescheme"); final AuthScope authscope8 = new AuthScope("https", "somehost", 80, "somerealm", "SomeScheme"); Assert.assertTrue(authscope1.equals(authscope1)); Assert.assertFalse(authscope1.equals(authscope2)); Assert.assertTrue(authscope1.equals(authscope3)); Assert.assertFalse(authscope1.equals(authscope4)); Assert.assertFalse(authscope1.equals(authscope5)); Assert.assertFalse(authscope1.equals(authscope6)); Assert.assertFalse(authscope1.equals(authscope7)); Assert.assertTrue(authscope7.equals(authscope8)); }