@Override
        public boolean equals(Object obj) {
            if ( this == obj )
                return true;
            if ( obj == null )
                return false;
            if ( getClass() != obj.getClass() )
                return false;
            Key other = (Key) obj;
            if ( awsAccessKeyId == null ) {
                if ( other.awsAccessKeyId != null )
                    return false;
            } else if ( !awsAccessKeyId.equals(other.awsAccessKeyId) )
                return false;
            if ( serviceEndpoint == null ) {
                if ( other.serviceEndpoint != null )
                    return false;
            } else if ( !serviceEndpoint.equals(other.serviceEndpoint) )
                return false;
            return true;
        }
Key object for the cache combines the access key and the service
endpoint.
aws-java-sdk-sts/src/main/java/com/amazonaws/auth/SessionCredentialsProviderFactory.java