class CheckmarxProjectSupport {

    protected void updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer(CheckmarxAdapterConfig config, List<CheckmarxEngineConfiguration> engineConfigurations, 
            CheckmarxSastScanSettings checkmarxScanSettings, InternalUpdateContext updateContext) {
        
        boolean updateEngineConfiguration = false;
        String sechubEngineConfigurationName = config.getEngineConfigurationName();
        String projectId = config.getProjectId();
        long engineConfigurationId = checkmarxScanSettings.getEngineConfigurationId();
 
        LOG.debug("SecHub engine configuration name {}", sechubEngineConfigurationName);
        
        CheckmarxEngineConfiguration sechubEngineConfiguration = findEngineConfigurationByName(sechubEngineConfigurationName, engineConfigurations);
        
        if (sechubEngineConfiguration == null) {
            LOG.warn("[ALERT] ILLEGAL_STATE CHECKMARX_ADAPTER no engine configuration available!");
        } else  {
            LOG.debug("Found SecHub engine configuration {}", sechubEngineConfiguration.toString());
            
            if (sechubEngineConfiguration.getId() != engineConfigurationId) {
                LOG.debug("SecHub engine configuration id {} and Checkmarx engine configuration id {} are different.", sechubEngineConfiguration.getId(),
                        engineConfigurationId);
                LOG.debug("Wanted engine configuration id {} for project {}", sechubEngineConfiguration.getId(), projectId);
                engineConfigurationId = sechubEngineConfiguration.getId();
                updateEngineConfiguration = true;
            } else {
                LOG.debug("Engine configuration id is already set to {} for project", sechubEngineConfigurationName, projectId);
            }
        }
        
        updateContext.setUpdateEngineConfiguration(updateEngineConfiguration);
        updateContext.setEngineConfigurationId(engineConfigurationId);
    }

}