### Question:
ExtensionHistoryScriptService extends AbstractExtensionScriptService { public ExtensionHistoryFilter getRecords() { return new ExtensionHistoryFilter(); }  ExtensionHistoryFilter getRecords(); String serialize(ExtensionJobHistoryRecord record); List<ExtensionJobHistoryRecord> deserialize(String serializedHistoryRecords); List<ExtensionJobHistoryRecord> read(InputStream inputStream); Job replay(List<ExtensionJobHistoryRecord> records); List<ExtensionJobHistoryRecord> createReplayPlan(List<ExtensionJobHistoryRecord> records,
        boolean preserveUsers, Collection<String> namespaces); ReplayJobStatus getReplayJobStatus(String id); static final String ID; }### Answer:
@Test public void getRecords() throws Exception { InstallRequest devInstallReq = new InstallRequest(); devInstallReq.addNamespace("wiki:dev"); ExtensionJobHistoryRecord devInstall = new ExtensionJobHistoryRecord("install", devInstallReq, null, null, null); UninstallRequest devUninstallReq = new UninstallRequest(); devUninstallReq.addNamespace("wiki:dev"); ExtensionJobHistoryRecord devUninstall = new ExtensionJobHistoryRecord("uninstall", devUninstallReq, null, null, null); ExtensionJobHistoryRecord globalInstall = new ExtensionJobHistoryRecord("install", new InstallRequest(), null, null, null); ExtensionJobHistoryRecord globalUninstall = new ExtensionJobHistoryRecord("uninstall", new UninstallRequest(), null, null, null); InstallRequest draftsInstallReq = new InstallRequest(); draftsInstallReq.addNamespace("wiki:drafts"); ExtensionJobHistoryRecord draftsInstall = new ExtensionJobHistoryRecord("install", draftsInstallReq, null, null, null); List<ExtensionJobHistoryRecord> records = Arrays.asList(devInstall, globalInstall); ExtensionJobHistory history = this.mocker.getInstance(ExtensionJobHistory.class); ArgumentCaptor<Predicate<ExtensionJobHistoryRecord>> predicateCaptor = ArgumentCaptor.forClass((Class) Predicate.class); when(history.getRecords(predicateCaptor.capture(), eq("offsetRecordId"), eq(5))).thenReturn(records); when(this.xcontext.getWikiId()).thenReturn("dev"); assertEquals( records, this.mocker.getComponentUnderTest().getRecords().fromThisWiki().ofType(Arrays.asList("install")) .list("offsetRecordId", 5)); Predicate<ExtensionJobHistoryRecord> predicate = predicateCaptor.getValue(); assertTrue(predicate.evaluate(devInstall)); assertTrue(predicate.evaluate(globalInstall)); assertFalse(predicate.evaluate(devUninstall)); assertFalse(predicate.evaluate(globalUninstall)); assertFalse(predicate.evaluate(draftsInstall)); }