code: public static List<Integer> fillUpWithNulls(List<Integer> list, Integer replace) {
  		Collections.sort(list);
  		int minValue = list.get(0);
  		int maxValue = list.get(list.size() - 1);
  		int range = (int) (maxValue - Math.signum(minValue) * Math.abs(minValue));
  
  		List<Integer> result = new ArrayList<>(range + 1);
  		for (int i = 0; i < list.size() - 1; i++) {
  			result.add(replace != null ? replace : list.get(i));
  			for (int j = 0; j < list.get(i + 1) - list.get(i) - 1; j++)
  				result.add(null);
  		}
  		result.add(replace != null ? replace : maxValue);
  		return result;
  	}
docs: Expands an integer list to a size equal to its value range and adds
  <code>null</code>-value entries for every missing intermediate integer
  value. If <code>replace</code> is not <code>null</code>, all original
  values are replaced by <code>replace</code>.
  
  @param list
  List containing integer values
  @param replace
  Replacement for existing values within <code>list</code>
  @return An expanded list containing null values for missing intermediate
  integer values and optionally replaced original values