private static void setPreferredSizeToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth) {
    int width = calcWidthToFitText(textField, text, additionalWidth);
    setPreferredWidth(textField, width);
  }
private static void setPreferredSizeToFitText(@NotNull JTextField textField, @NotNull String text, int additionalWidth)