UpdateParentFactory implements FindChildrenStreamEndPlugin.Factory { @Override public FindChildrenStreamEndPlugin.Handler build() { return new UpdateParent(factory.build()); } UpdateParentFactory(Factory factory); Factory getFactory(); @Override FindChildrenStreamEndPlugin.Handler build();  }
@Test public void testBuild() { UpdateParentFactory.Factory factory = mock(UpdateParentFactory.Factory.class); UpdateParent.UpdateField updateField = mock(UpdateParent.UpdateField.class); when(factory.build()).thenReturn(updateField); UpdateParentFactory updateParentFactory = new UpdateParentFactory(factory); FindChildrenStreamEndPlugin.Handler handler = updateParentFactory.build(); assertThat(handler, is(instanceOf(UpdateParent.class))); }