docs: public static <E> int add(List<E> list, Comparator<? super E> comparator, E data,
  			boolean allowMultipleOccurencesOfSameValue, boolean allowReplacement) {
  		assert list != null;
  		assert comparator != null;
  		assert data != null;
  		int first = 0;
  		int last = list.size() - 1;
  		while (last >= first) {
  			final int center = (first + last) / 2;
  			final E dt = list.get(center);
  			final int cmpR = comparator.compare(data, dt);
  			if (cmpR == 0 && !allowMultipleOccurencesOfSameValue) {
  				if (allowReplacement) {
  					list.set(center, data);
  					return center;
  				}
  				return -1;
  			}
  			if (cmpR < 0) {
  				last = center - 1;
  			} else {
  				first = center + 1;
  			}
  		}
  		list.add(first, data);
  		return first;
  	}