class DiscoverableURIs {

    public void forEach( BiConsumer<String,URI> consumer )
    {
        entries.stream().collect( Collectors.groupingBy( e -> e.key ) )
                .forEach( ( key, list ) -> list.stream()
                        .max( Comparator.comparing( e -> e.precedence ) )
                        .ifPresent( e -> consumer.accept( key, e.uri ) ) );
    }

    private  DiscoverableURIs( Collection<URIEntry> entries );

}