void (String action, Object element) { NodeElement stopElement = new NodeElement("com"); if (cancelled.get()) { myCancelRequest = new AssertionError("Not supposed to update after element=" + stopElement); return; } if (element.equals(stopElement) && action.equals("getChildren")) { cancelled.set(true); getBuilder().cancelUpdate(); } }