docs: @SuppressWarnings("unchecked")
    public void reduceToKeys(Set<String> keys) {
      if (size > 0) {
        int sizeCopy = size;
        String[] keyListCopy = keyList.clone();
        int[] errorNumberCopy = errorNumber.clone();
        HashMap<String, Integer>[] errorListCopy = errorList.clone();
        int[] sourceNumberListCopy = sourceNumberList.clone();
        T1[] advancedValueSumListCopy = advancedValueSumList.clone();
        T1[] advancedValueMaxListCopy = advancedValueMaxList.clone();
        T1[] advancedValueMinListCopy = advancedValueMinList.clone();
        T1[] advancedValueSumOfSquaresListCopy = advancedValueSumOfSquaresList
            .clone();
        T2[] advancedValueSumOfLogsListCopy = advancedValueSumOfLogsList.clone();
        long[] advancedValueNListCopy = advancedValueNList.clone();
        keyList = new String[keys.size()];
        errorNumber = new int[keys.size()];
        errorList = new HashMap[keys.size()];
        sourceNumberList = new int[keys.size()];
        advancedValueSumList = operations.createVector1(keys.size());
        advancedValueMaxList = operations.createVector1(keys.size());
        advancedValueMinList = operations.createVector1(keys.size());
        advancedValueSumOfSquaresList = operations.createVector1(keys.size());
        advancedValueSumOfLogsList = operations.createVector2(keys.size());
        advancedValueNList = new long[keys.size()];
        size = 0;
        for (int i = 0; i < sizeCopy; i++) {
          if (keys.contains(keyListCopy[i])) {
            keyList[size] = keyListCopy[i];
            errorNumber[size] = errorNumberCopy[i];
            errorList[size] = errorListCopy[i];
            sourceNumberList[size] = sourceNumberListCopy[i];
            advancedValueSumList[size] = advancedValueSumListCopy[i];
            advancedValueMaxList[size] = advancedValueMaxListCopy[i];
            advancedValueMinList[size] = advancedValueMinListCopy[i];
            advancedValueSumOfSquaresList[size] = advancedValueSumOfSquaresListCopy[i];
            advancedValueSumOfLogsList[size] = advancedValueSumOfLogsListCopy[i];
            advancedValueNList[size] = advancedValueNListCopy[i];
            size++;
          }
        }
      }
    }