void (@NotNull JTree tree, @NotNull StructureViewModel structureViewModel) { tree.getModel().addTreeModelListener(new MyExpandListener( tree, ObjectUtils.tryCast(structureViewModel, StructureViewModel.ExpandInfoProvider.class))); }