code: protected static Number sum(List<?> slaveValues) {
          for (Object slaveValue : slaveValues) {
              if (slaveValue != null) {
                  final Class<? extends Object> cls = slaveValue.getClass();
                  if (!(cls == Integer.class || cls == Short.class || cls == Byte.class)) {
                      return sumAsDouble(slaveValues);
                  }
              }
          }
          return sumAsInteger(slaveValues);
      }
docs: Helper method to get a sum of values (values will be checked whether they
  are integers only, or else a double will be returned).
  
  @param slaveValues
  @return