code: public static Dimension rectangleDoubleToDimension(final Rectangle2D.Double rectangle) {
          return new Dimension(
                  (int) Math.round(rectangle.width),
                  (int) Math.round(rectangle.height));
      }
docs: Round the size of a rectangle with double values.
  
  @param rectangle The rectangle.
  @return