void (@NotNull Element targetElement, Object node) { if (node instanceof Content) { targetElement.addContent((Content)node); } else if (node instanceof List) { //noinspection unchecked targetElement.addContent((List)node); } else { throw new IllegalArgumentException("Wrong node: " + node); } }