FontInfo (Object item) { for (FontInfo info : myMonospacedOnly ? myMonoFonts : myAllFonts) { if (item instanceof String ? info.toString().equalsIgnoreCase((String)item) : info.equals(item)) { return info; } } return null; }