code: private static void roundAndAdd(Collection<Integer> result, double value)
      {
          int roundedValue = (int) Math.round(value);
  
          if (!result.contains(roundedValue))
          {
              result.add(roundedValue);
          }
      }
docs: Rounds the specified floating point value to the nearest integer and adds it to the specified list of integers,
  provided it is not already in the list.
  
  @param result The list of integers to add to.
  @param value  The new candidate to round and add to the list.