SSHKeysDisplayer implements SSHKeysDisplayerView.Presenter,
                                         IsElement { public void render(Collection<PortableSSHPublicKey> keys) { clear(); keys.forEach(this::addKeyEditor); } @Inject  SSHKeysDisplayer(final SSHKeysDisplayerView view, final ManagedInstance<SSHKeyEditor> editors); void init(final Command addCommand, final ParameterizedCommand<PortableSSHPublicKey> deleteCommand); void render(Collection<PortableSSHPublicKey> keys); @Override HTMLElement getElement(); @PreDestroy void clear(); @Override void notifyAdd();  }
@Test public void testRenderKeys() { List<PortableSSHPublicKey> keys = new ArrayList<>(); keys.add(key); keys.add(mock(PortableSSHPublicKey.class)); keys.add(mock(PortableSSHPublicKey.class)); displayer.render(keys); assertEquals(keys.size(), createdEditors.size()); verify(editors, times(keys.size())).get(); createdEditors.forEach(editor -> verify(editor).render(any(), any())); }