@Override
    public boolean equals(final Object o) {
        if(this == o) {
            return true;
        }
        if(!(o instanceof Credentials)) {
            return false;
        }
        final Credentials that = (Credentials) o;
        return Objects.equals(user, that.user) &&
                Objects.equals(password, that.password) &&
                Objects.equals(tokens, that.tokens) &&
                Objects.equals(oauth, that.oauth) &&
                Objects.equals(identity, that.identity) &&
                Objects.equals(certificate, that.certificate);
    }
@Test
    public void testEquals() {
        assertEquals(new Credentials("a", "b"), new Credentials("a", "b"));
        assertNotSame(new Credentials("a", "b"), new Credentials("a", "c"));
        assertNotEquals(new Credentials("a", "b"), new Credentials("a", "c"));
    }