ExecutionNode (@Nullable ExecutionNode result) { assert myIsCorrectThread.get(); if (myParentNode != null) { List<ExecutionNode> parentVisibleChildrenList = myParentNode.myVisibleChildrenList; if (parentVisibleChildrenList != null) { Predicate<? super ExecutionNode> filter = myParentNode.myFilter; if (myAlwaysVisible || filter != null) { boolean wasPresent = parentVisibleChildrenList.contains(this); boolean shouldBePresent = myAlwaysVisible || filter.test(this); if (shouldBePresent != wasPresent) { if (shouldBePresent) { myParentNode.maybeReapplyFilter(); } else { parentVisibleChildrenList.remove(this); } result = myParentNode; } } } return myParentNode.reapplyParentFilterIfRequired(result); } return result; }