TreeState (@Nullable Element element) { TreeState state = new TreeState(new ArrayList<>(), new ArrayList<>()); try { if (element != null) { state.readExternal(element); } } catch (InvalidDataException e) { LOG.warn(e); } return state; }