void (@Nullable ContentManager contentManager) { if (contentManager == null) return; Content targetContent = null; switch (myNavigationType) { case PREV -> { contentManager.selectPreviousContent(); return; } case NEXT -> { contentManager.selectNextContent(); return; } case LAST -> targetContent = contentManager.getContent(contentManager.getContentCount() - 1); default -> { int targetIndex = myNavigationType.ordinal(); if (contentManager.getContentCount() >= targetIndex + 1) { targetContent = contentManager.getContent(targetIndex); } } } if (targetContent != null) { contentManager.setSelectedContent(targetContent, true); } }