public Optional<String> retrieveTitle(final GRN itemGrn, final SearchUser searchUser) {
        if (isSpecialView(itemGrn)) {
            final ViewResolverDecoder decoder = new ViewResolverDecoder(itemGrn.entity());
            if (decoder.isResolverViewId()) {
                final ViewResolver viewResolver = viewResolvers.get(decoder.getResolverName());
                if (viewResolver != null) {
                    Optional<ViewDTO> view = viewResolver.get(decoder.getViewId());
                    if (view.isPresent() && searchUser.canReadView(view.get())) {
                        return Optional.ofNullable(view.get().title());
                    }
                }
            }
        }
        final Optional<Catalog.Entry> entry = catalog.getEntry(itemGrn);
        final Optional<String> title = entry.map(Catalog.Entry::title);
        if (title.isPresent()) {
            return title;
        } else {
            return entry.map(Catalog.Entry::id);
        }


    }
@Test
    void testReturnsTitleIfPresent() throws Exception {
        doReturn(Optional.of(new Catalog.Entry("id", "title"))).when(catalog).getEntry(any());
        assertEquals(Optional.of("title"), toTest.retrieveTitle(grn, searchUser));
    }