class InstantRunTransform extends Transform {

    @Override
    public void transform(@NonNull TransformInvocation invocation)
            throws IOException, TransformException, InterruptedException {
        List<JarInput> jarInputs =
                invocation
                        .getInputs()
                        .stream()
                        .flatMap(input -> input.getJarInputs().stream())
                        .collect(Collectors.toList());
        if (!jarInputs.isEmpty()) {
            jarInputs.forEach(
                    jar ->
                            Preconditions.checkState(
                                    !jar.getFile().exists(),
                                    "%s must not exist",
                                    jar.getFile().toString()));
            // just log as warning until https://issuetracker.google.com/72032032 is fixed
            LOGGER.warning("Unexpected inputs: %s", Joiner.on(", ").join(jarInputs));
        }
        InstantRunBuildContext buildContext = transformScope.getInstantRunBuildContext();
        buildContext.startRecording(InstantRunBuildContext.TaskType.INSTANT_RUN_TRANSFORM);
        try {
            doTransform(invocation);
        } finally {
            buildContext.stopRecording(InstantRunBuildContext.TaskType.INSTANT_RUN_TRANSFORM);
        }

    }

    public  InstantRunTransform(WaitableExecutor executor, InstantRunVariantScope transformScope);

}