MyPlugin implements PanelPlugin, ConfigurablePanel<MyModel> { public MyModel getModel( Project project ) { MyModel extensionModel = (MyModel) project.getExtensionModel( getId() ); if ( extensionModel == null ) { extensionModel = new MyModel(); project.addExtensionModel( extensionModel ); } return extensionModel; }  List<PanelItem> getItems( Project project ); String getTitle( Project project ); MyModel getModel( Project project ); String getId();  }
@Test public void testGetModel() { assert project.getExtensionModel( "my-plugin" ) == null; MyModel model = plugin.getModel( project ); assert model == project.getExtensionModel( "my-plugin" ); assert model == plugin.getModel( project ); }