CustomRegExpInspection (@NotNull InspectionProfile profile) { final InspectionToolWrapper<?, ?> wrapper = profile.getInspectionTool(CustomRegExpInspection.SHORT_NAME, (Project)null); assert wrapper != null; return (CustomRegExpInspection)wrapper.getTool(); }