code: protected static ImmutableList<VariableOrGroundTerm> extractArguments(DataAtom atom,
                                                                            ImmutableList<Integer> positions) {
          ImmutableList.Builder<VariableOrGroundTerm> listBuilder = ImmutableList.builder();
          int atomLength = atom.getArguments().size();
  
          for (Integer keyIndex : positions) {
              if (keyIndex > atomLength) {
                  // TODO: find another exception
                  throw new RuntimeException("The key index does not respect the arity of the atom " + atom);
              }
              else {
                  listBuilder.add(atom.getTerm(keyIndex - 1));
              }
          }
          return listBuilder.build();
      }
docs: Returns the list of the terms from atom corresponding
  to the positions
  TODO: explain