I will rewrite it like this :)

    val builder = Seq("SDK_IT_PROJECT_KEY", "SDK_IT_CLIENT_ID", "SDK_IT_CLIENT_SECRET")
        .map(key => envOrNone(key) map Right.apply getOrElse Left(key))
        .partition(_.isLeft) match {
      case (Nil, Right(projectKey) :: Right(clientId) :: Right(clientSecret) :: Nil) =>
        new SphereClientConfig.Builder(projectKey, clientId, clientSecret, Locale.ENGLISH)
      case (missing, _) =>
        throw new RuntimeException(s"Missing environment variables: ${missing map (_.left.get) mkString ","}")
    }

    envOrNone("SDK_IT_SERVICE_URL") foreach builder.setCoreHttpServiceUrl
    envOrNone("SDK_IT_AUTH_URL") foreach builder.setAuthHttpServiceUrl

    SphereClient.create(builder.build)