class ValidateAssignmentHelper extends BaseHelper {

    public void validateUserAssignment() {
        boolean keycloakConfigured = allSharedPreferences.getBooleanPreference(IS_KEYCLOAK_CONFIGURED);
        if (!keycloakConfigured) {
            return;
        }
        try {
            String assignment = getUserAssignment();
            if (StringUtils.isNotBlank(assignment)) {
                UserAssignmentDTO currentUserAssignment = gson.fromJson(assignment, UserAssignmentDTO.class);
                Set<Long> existingOrganizations = userService.fetchOrganizations();
                Set<String> existingJurisdictions = new HashSet<>(locationRepository.getAllLocationIds());
                Set<String> existingPlans = planDefinitionRepository.findAllPlanDefinitionIds();
                boolean newAssignments = hasNewAssignments(currentUserAssignment, existingOrganizations, existingJurisdictions);
                UserAssignmentDTO removedAssignments = processRemovedAssignments(currentUserAssignment, existingOrganizations, existingJurisdictions, existingPlans);
                if (newAssignments) {
                    logoff(R.string.account_new_assignment_logged_off);
                    resetSync();
                } else if (removedAssignments.isRemoved()) {
                    Intent intent = new Intent();
                    intent.setAction(ACTION_ASSIGNMENT_REMOVED);
                    intent.putExtra(ASSIGNMENTS_REMOVED, removedAssignments);
                    CoreLibrary.getInstance().context().applicationContext().sendBroadcast(intent);
                }
            }
        } catch (Exception e) {
            Timber.e(e);
        }
    }

    public  ValidateAssignmentHelper(SyncUtils syncUtils);

}