@Test public void testEqualsDifferent() { final TemplateLibrary library=getLibrary(); library.accept( new TemplateConsumer() { @Override protected void processTemplate(final ResourceTemplate template) { library.accept( new TemplateConsumer() { @Override protected void processTemplate(final ResourceTemplate other) { if(template!=other) { assertThat(other,not(equalTo(template))); } } } ); } } ); }
@Override public void accept(TemplateVisitor visitor) { checkNotNull(visitor,"Template visitor cannot be null"); for(ResourceTemplate template:this.context.registeredTemplates()) { template.accept(visitor); } }
MutableTemplateLibrary implements TemplateLibrary { @Override public void accept(TemplateVisitor visitor) { checkNotNull(visitor,"Template visitor cannot be null"); for(ResourceTemplate template:this.context.registeredTemplates()) { template.accept(visitor); } } }
MutableTemplateLibrary implements TemplateLibrary { @Override public void accept(TemplateVisitor visitor) { checkNotNull(visitor,"Template visitor cannot be null"); for(ResourceTemplate template:this.context.registeredTemplates()) { template.accept(visitor); } } MutableTemplateLibrary(); }
MutableTemplateLibrary implements TemplateLibrary { @Override public void accept(TemplateVisitor visitor) { checkNotNull(visitor,"Template visitor cannot be null"); for(ResourceTemplate template:this.context.registeredTemplates()) { template.accept(visitor); } } MutableTemplateLibrary(); @Override ResourceTemplate findByHandler(Class<? extends ResourceHandler> handlerClass); @Override ResourceTemplate findById(String templateId); @Override boolean contains(ResourceTemplate template); @Override void accept(TemplateVisitor visitor); @Override String toString(); }
MutableTemplateLibrary implements TemplateLibrary { @Override public void accept(TemplateVisitor visitor) { checkNotNull(visitor,"Template visitor cannot be null"); for(ResourceTemplate template:this.context.registeredTemplates()) { template.accept(visitor); } } MutableTemplateLibrary(); @Override ResourceTemplate findByHandler(Class<? extends ResourceHandler> handlerClass); @Override ResourceTemplate findById(String templateId); @Override boolean contains(ResourceTemplate template); @Override void accept(TemplateVisitor visitor); @Override String toString();  }