public static String getFieldToNullName( LogChannelInterface log, String field, boolean isUseExtId ) {
    String fieldToNullName = field;
    if ( isUseExtId ) {
      // verify if the field has correct syntax
      if ( !FIELD_NAME_WITH_EXTID_PATTERN.matcher( field ).matches() ) {
        if ( log.isDebug() ) {
          log.logDebug( BaseMessages.getString( PKG, "SalesforceUtils.Warn.IncorrectExternalKeySyntax", field,
              fieldToNullName ) );
        }
        return fieldToNullName;
      }

      String lookupField = field.substring( field.indexOf( EXTID_SEPARATOR ) + 1 );
      // working with custom objects and relationship
      // cut off _r and then add _c in the end of the name
      if ( lookupField.endsWith( CUSTOM_OBJECT_RELATIONSHIP_FIELD_SUFFIX ) ) {
        fieldToNullName =
            lookupField.substring( 0, lookupField.length() - CUSTOM_OBJECT_RELATIONSHIP_FIELD_SUFFIX.length() )
                + CUSTOM_OBJECT_SUFFIX;
        if ( log.isDebug() ) {
          log.logDebug( BaseMessages.getString( PKG, "SalesforceUtils.Debug.NullFieldName", fieldToNullName ) );
        }
        return fieldToNullName;
      }

      fieldToNullName = lookupField + "Id";
    }

    if ( log.isDebug() ) {
      log.logDebug( BaseMessages.getString( PKG, "SalesforceUtils.Debug.NullFieldName", fieldToNullName ) );
    }

    return fieldToNullName;
  }
@Test
  public void testIncorrectExternalKeySyntaxWarnIsLoggedInDebugMode() {
    when( logMock.isDebug() ).thenReturn( true );
    inputFieldName = "AccountId";
    verify( logMock, never() ).logDebug( anyString() );
    SalesforceUtils.getFieldToNullName( logMock, inputFieldName, true );
    verify( logMock ).logDebug(
        "The field has incorrect external key syntax: AccountId. Syntax for external key should be : object:externalId/lookupField. Trying to use fieldToNullName=AccountId." );
  }