### Question:
NavigationLinksListener implements RenderingListener { @Override public <T> void eventOccurred( RenderingEvent<T> event ) throws IOException { Selector selector = event.getSelector(); if (event.getType() != RenderingEventType.POJO_CHILD || selector.isInfluencedExternally()) { return; } Class<T> instanceType = event.getValueType(); T instance = event.getValue(); String urlSuffix = event.getRequestContext().getUrlSuffix(); MapHierarchicalModel<?> navigationLinks = ( ( MapHierarchicalModel<?> ) event.getModel() ) .createChildMap( "navigationLinks" ); Collection<Property<T>> fieldNames = getNonSelectedFields( selector, instanceType, instance ); SelectorParser selectorParser = event.getRequestContext().getSelectorParser(); String format; if (selectorParser instanceof LinkedInSelectorParser) { format = "%s?selector=:(%s)"; } else if (selectorParser instanceof GDataSelectorParser) { format = "%s?selector=%s"; } else { throw new IllegalStateException( "Unknown selector type: " + selectorParser.getClass().getName() ); } for ( Property<?> field : fieldNames ) { String fieldName = field.name(); MapHierarchicalModel<?> navModel = navigationLinks.createChildMap( fieldName ); navModel.addProperty( SelectorParser.HREF, uriGenerator.getUrl( event, String.format( format, urlSuffix, fieldName ) ) ); navModel.addProperty( "name", fieldName ); navModel.finished(); } navigationLinks.finished(); } NavigationLinksListener(); @Deprecated /** use the UriGenerator constructor */  NavigationLinksListener( HrefListener hrefListener );  NavigationLinksListener( UriGenerator uriGenerator ); @Deprecated /** use setUriGenerator instead */ void setHrefListener( HrefListener hrefListener ); void setUriGenerator( UriGenerator uriGenerator ); @Override void eventOccurred( RenderingEvent<T> event ); Collection<Property<T>> getNonSelectedFields( Selector selector, Class<T> instanceType, Object instance );  }### Answer:
@Test public void testBasic() throws IOException { BasicTestDataLeaf leaf = new BasicTestDataLeaf(); ObjectMapHierarchicalModelImpl model = new ObjectMapHierarchicalModelImpl(); RenderingEvent<BasicTestDataLeaf> event = new RenderingEvent<BasicTestDataLeaf>( RenderingEventType.POJO_CHILD, model, leaf, BasicTestDataLeaf.class, requestContext, new CoreSelector( new DefaultEntityConfigurationRegistry() ) ); new NavigationLinksListener().eventOccurred( event ); Map<String, Object> objectTree = model.getUnderlyingModel(); Map<String, Object> navLinks = getMap( objectTree, "navigationLinks" ); Assert.assertNotNull( navLinks ); Map<String, Object> otherMap = getMap( navLinks, "other" ); Assert.assertNotNull( otherMap ); Assert.assertEquals( "/basic-leaf/0.map?selector=other", otherMap.get( "href" ) ); }