boolean (Object obj) { if (obj instanceof RemoteConnectionCredentialsWrapper w) { try { Object credentials = getCredentials(); Object counterCredentials = w.getCredentials(); return credentials.equals(counterCredentials); } catch (IllegalStateException e) { return false; } } return false; }