Object[] (boolean showAnonymous, boolean showFields) { myFixture.configureByText("Foo.java", CLASS_WITH_ANONYMOUS); Ref<Object[]> ref = Ref.create(); myFixture.testStructureView(svc -> { svc.setActionActive(JavaAnonymousClassesNodeProvider.ID, showAnonymous); svc.setActionActive(FieldsFilter.ID, !showFields); ref.set(getElements(svc)); }); return ref.get(); }