public void setCredential(Credentials credential) {
        boolean changed = !(credentials == credential || (credentials != null && credentials.identical(credential)));
        credentials = credential;
        if (changed && listener != null) {
            listener.onUpdateCredential();
        }
    }
@Test
    void testSetCredential() {
        CredentialService credentialService1 = CredentialService.getInstance();
        Credentials credential = new Credentials();
        //when
        credentialService1.setCredential(credential);
        //then
        assertEquals(credential, credentialService1.getCredential());
    }