ModuleOrderEntry (@NotNull ModuleRootModel model, @Nullable Module module) { if (module == null) return null; for (OrderEntry orderEntry : model.getOrderEntries()) { if (orderEntry instanceof ModuleOrderEntry && module.equals(((ModuleOrderEntry)orderEntry).getModule())) { return (ModuleOrderEntry)orderEntry; } } return null; }