code: private int numAdditions(Set<Integer> addCandidates, SubsetSolution sol){
          int a = Math.min(numAdditions, Math.min(addCandidates.size(), maxSubsetSize-sol.getNumSelectedIDs()));
          return Math.max(a, 0);
      }
docs: Computes the number of additions that are to be performed, given the set of add candidates
  and the current subset solution. Takes into account the desired number of additions \(k\)
  specified at construction, the number of currently unselected non-fixed items and the maximum
  allowed subset size (if any).
  
  @param addCandidates candidate IDs to be added to the selection
  @param sol subset solution for which moves are being generated
  @return number of additions to be performed