PackagingElementNode (Object value) { if (!(value instanceof DefaultMutableTreeNode)) return null; final Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); return userObject instanceof PackagingElementNode ? (PackagingElementNode)userObject : null; }