code: public long roundHalfFloor(long instant) {
          long floor = roundFloor(instant);
          long ceiling = roundCeiling(instant);
  
          long diffFromFloor = instant - floor;
          long diffToCeiling = ceiling - instant;
  
          if (diffFromFloor <= diffToCeiling) {
              // Closer to the floor, or halfway - round floor
              return floor;
          } else {
              return ceiling;
          }
      }
docs: Round to the nearest whole unit of this field. If the given millisecond
  value is closer to the floor or is exactly halfway, this function
  behaves like roundFloor. If the millisecond value is closer to the
  ceiling, this function behaves like roundCeiling.
  
  @param instant  the milliseconds from 1970-01-01T00:00:00Z to round
  @return rounded milliseconds