class Updater extends Task<UpdateSummary> {

    @Override
    protected UpdateSummary call() throws Exception {
        highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir));
        newHighestVersion = highestLocalVersion;
        UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex());
        return new UpdateSummary(newHighestVersion, updates);
    }

}

class UpdaterTest {

    private static final int HTTP_LOCAL_TEST_PORT;
    public static final String SERVER_PATH;
    private HttpServer localServer;
    private Map<String, byte[]> paths;
    private Updater updater;
    private Path dir;
    private URI indexURL;
    private long workDone;
    private List<BigInteger> privKeys;
    private List<ECPoint> pubKeys;

    @Test(expected = SignatureException.class)
    public void badSig() throws Exception {

        byte[] fakePatch = new byte[1024];
        Arrays.fill(fakePatch, (byte) 0x42);
        paths.put("/2.jar.bpatch", fakePatch);
        UFXProtocol.SignedUpdates.Builder builder = makeWrongIndex();
        builder.setSignatures(0, "bzzzz");
        paths.put("/index", builder.build().toByteArray());
        updater = new TestUpdater(indexURL, "UnitTest", dir, null);
        updater.call();
    }

}