@LocalData
public void testBuildLatestPatchsetOnly() throws Exception {
GerritServer gerritServer = PluginImpl.getInstance().getServer(PluginImpl.DEFAULT_SERVER_NAME);
((Config)gerritServer.getConfig()).setGerritBuildCurrentPatchesOnly(true);
FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJob(j, "projectX");
project.getBuildersList().add(new SleepBuilder(2000));
server.waitForCommand(GERRIT_STREAM_EVENTS, 2000);
ManualPatchsetCreated firstEvent = Setup.createManualPatchsetCreated();
AtomicReference<AbstractBuild> firstBuildRef = TestUtils.getFutureBuildToStart(firstEvent);
gerritServer.triggerEvent(firstEvent);
AbstractBuild firstBuild = TestUtils.waitForBuildToStart(firstBuildRef);