code: private int setSecDataArr(ArrayList inArr, ArrayList outArr) {
  
          if (!inArr.isEmpty()) {
              for (int j = 0; j < outArr.size(); j++) {
                  if (outArr.get(j).equals(inArr)) {
                      return j + 1;
                  }
              }
              outArr.add(inArr);
              return outArr.size();
          } else {
              return 0;
          }
      }
docs: Get index value of the record and set new id value in the array
  
  @param inArr sub array of data
  @param outArr array of sub data
  @return current index value of the sub data