Object (Object item) { if (item instanceof DefaultNavBarItem<?> defaultNavBarItem) { Object data = defaultNavBarItem.getData(); if (data instanceof ServiceModel.ServiceViewItem serviceViewItem) { return serviceViewItem.getValue(); } } return item; }