### Question:
DefaultHarvest implements Harvest { @Override public Harvester getHarvester(final ConfigSource source, final HarvestLoadCallback callback) throws IOException { final Config config = configFactory.create(source); final Harvester harvester = harvestFactory.create(config); config.reload(); callback.onSuccess(config.getElementDef().getElementDefs()); return harvester; } @Inject  DefaultHarvest(final ConfigFactory configFactory,
            final HarvesterFactory harvestFactory,
            final HandlerHolder handlerHolder, final EventSink eventSink); @Override Harvester getHarvester(final ConfigSource source,
            final HarvestLoadCallback callback); @Override void addEventHandler(final EventHandler<?> handler); @Override void postEvent(final E event);  }### Answer:
@Test public void testGetHarvester() throws IOException { final List<IElementDef> emptyList = Collections.emptyList(); expect(mockConfigFactory.create(mockConfigSource)).andReturn(mockConfig); expect(mockFactory.create(mockConfig)). andReturn(mockHarvester); mockConfig.reload(); expectLastCall(); expect(mockConfig.getElementDef()).andReturn(mockElementDef); expect(mockElementDef.getElementDefs()).andReturn(emptyList); mockLoadCallback.onSuccess(emptyList); expectLastCall(); EasyMockUnitils.replay(); final Harvester harvester = harvest.getHarvester(mockConfigSource, mockLoadCallback); assertNotNull(harvester); assertSame(mockHarvester, harvester); }