Rectangle (@NotNull Extension extension) { for (IconHolder holder : icons.values()) { if (holder.extension == extension) { return new Rectangle(holder.bounds); } } throw new IllegalArgumentException("The " + extension + " extension does not exist in this text field"); }