private static @NotNull Rectangle applyInsets(@NotNull Rectangle rect, @Nullable Insets i) {
    rect = new Rectangle(rect);
    JBInsets.removeFrom(rect, i);
    return rect;
  }
private static @NotNull Rectangle applyInsets(@NotNull Rectangle rect, @Nullable Insets i)