Object[] (Object element) { Ref<Object[]> passOne = new Ref<>(); try (LockToken ignored = acquireLock()) { execute(new TreeRunnable("AbstractTreeUi.getChildrenFor") { @Override public void perform() { passOne.set(getTreeStructure().getChildElements(element)); } }); } catch (IndexNotReadyException e) { warnOnIndexNotReady(e); return ArrayUtilRt.EMPTY_OBJECT_ARRAY; } if (!Registry.is("ide.tree.checkStructure")) return passOne.get(); Object[] passTwo = getTreeStructure().getChildElements(element); Set<Object> two = ContainerUtil.newHashSet(passTwo); if (passOne.get().length != passTwo.length) { LOG.error( "AbstractTreeStructure.getChildren() must either provide same objects or new objects but with correct hashCode() and equals() methods. Wrong parent element=" + element); } else { for (Object eachInOne : passOne.get()) { if (!two.contains(eachInOne)) { LOG.error( "AbstractTreeStructure.getChildren() must either provide same objects or new objects but with correct hashCode() and equals() methods. Wrong parent element=" + element); break; } } } return passOne.get(); }