class EnvironmentUserSyncStateCalculator {

    @VisibleForTesting
    EnvironmentUserSyncState internalCalculateEnvironmentUserSyncState(String accountId, String envCrnString, UserSyncStatus userSyncStatus) {
        EnvironmentUserSyncState environmentUserSyncState = new EnvironmentUserSyncState();
        if (null == userSyncStatus || null == userSyncStatus.getLastStartedFullSync()) {
            environmentUserSyncState.setState(UserSyncState.STALE);
        } else {
            environmentUserSyncState.setLastUserSyncOperationId(userSyncStatus.getLastStartedFullSync().getOperationId());
            environmentUserSyncState.setState(calculateUserSyncState(accountId, envCrnString, userSyncStatus));
        }

        return environmentUserSyncState;
    }

}