private static void forgetCredentialType(@Nullable SdkAdditionalData additionalData, CredentialsType<?> credentialsType) {
    if (!(additionalData instanceof RemoteSdkAdditionalData data)) return;
    if (data.getRemoteConnectionType() != credentialsType) return;
    Element root = new Element("root");
    data.connectionCredentials().save(root);

    UnknownCredentialsHolder unknownCredentials = CredentialsType.UNKNOWN.createCredentials();
    unknownCredentials.setSdkId(data.getSdkId());
    try {
      CredentialsType.UNKNOWN.getHandler(unknownCredentials).load(root);
    }
    catch (CannotLoadCredentialsException e) {
      Logger.getInstance(CredentialsManager.class).warn(e);
    }
    data.setCredentials(CredentialsType.UNKNOWN.getCredentialsKey(), unknownCredentials);
  }
private static void forgetCredentialType(@Nullable SdkAdditionalData additionalData, CredentialsType<?> credentialsType)