public void free() {
        if (watcher != null) {
            watcher.stop();
        }
        LOGGER.info("[{}] {} is freed", appName, this.getClass().getSimpleName());
    }
@Test
    void testFree() throws NoSuchFieldException, IllegalAccessException {
        CredentialService credentialService1 = CredentialService.getInstance();
        CredentialWatcher mockWatcher = mock(CredentialWatcher.class);
        Field watcherField = CredentialService.class.getDeclaredField("watcher");
        watcherField.setAccessible(true);
        watcherField.set(credentialService1, mockWatcher);
        //when
        credentialService1.free();
        //then
        verify(mockWatcher, times(1)).stop();
    }