Object (Object component) { if (!(component instanceof DefaultMutableTreeNode node)) return null; final Object userObject = node.getUserObject(); if (!(userObject instanceof ProjectViewNode)) return null; return ((ProjectViewNode<?>)userObject).getValue(); }