code: @Override
      public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
              throws InvalidVariableException {
  
          JMeterVariables vars = getVariables();
  
          Double sum = 0D;
          String varName = ((CompoundVariable) values[values.length - 1]).execute().trim();
  
          for (int i = 0; i < values.length - 1; i++) {
              sum += Double.parseDouble(((CompoundVariable) values[i]).execute());
          }
  
          try {
              sum += Double.parseDouble(varName);
              varName = null; // there is no variable name
          } catch (NumberFormatException ignored) {
          }
  
          String totalString = Double.toString(sum);
          if (vars != null && varName != null && varName.length() > 0) {// vars will be null on TestPlan
              vars.put(varName, totalString);
          }
  
          return totalString;
  
      }
docs: {@inheritDoc}