Remove desugaring graph computation in AGP

The desugaring graph is now computed by D8, so the computation in AGP is
no longer used.

Also remove related unused classes and tests.

Bug: 141610358
Test: Removing unused tests
Change-Id: Ib90b1683cb13bbaa88700742c980f2faba81adfb
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringClassAnalyzer.java b/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringClassAnalyzer.java
deleted file mode 100644
index d92dfcb..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringClassAnalyzer.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.builder.dexing.ClassFileInput;
-import com.android.builder.utils.ZipEntryUtils;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Sets;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Handle;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-
-/**
- * Analyzer implemented using ASM visitors to collect information about desugaring dependencies.
- *
- * <p>This analyzer generates {@link DesugaringData} that describes local desugaring dependencies
- * for a single type coming from a .class file or a .jar. To learn which information is relevant for
- * calculating the desugaring dependencies, please see {@link DesugaringData}.
- */
-public class DesugaringClassAnalyzer {
-
-    @NonNull
-    public static List<DesugaringData> analyze(@NonNull Path path) throws IOException {
-        if (Files.isDirectory(path)) {
-            return analyzeDir(path);
-        } else if (Files.isRegularFile(path)) {
-            if (path.toString().endsWith(SdkConstants.DOT_JAR)) {
-                return analyzeJar(path);
-            } else if (ClassFileInput.CLASS_MATCHER.test(path.toString())) {
-                return ImmutableList.of(analyzeClass(path));
-            } else {
-                return ImmutableList.of();
-            }
-        } else {
-            throw new IOException("Unable to process " + path.toString());
-        }
-    }
-
-    @NonNull
-    private static List<DesugaringData> analyzeJar(@NonNull Path jar) throws IOException {
-        Preconditions.checkArgument(
-                jar.toString().endsWith(SdkConstants.DOT_JAR) && Files.isRegularFile(jar),
-                "Not a .jar file: %s",
-                jar.toString());
-
-        List<DesugaringData> data;
-        try (ZipFile zip = new ZipFile(jar.toFile())) {
-            data = new ArrayList<>(zip.size());
-            Enumeration<? extends ZipEntry> entries = zip.entries();
-            while (entries.hasMoreElements()) {
-                ZipEntry zipEntry = entries.nextElement();
-                if (!ZipEntryUtils.isValidZipEntryName(zipEntry)) {
-                    continue;
-                }
-                if (!ClassFileInput.CLASS_MATCHER.test(zipEntry.getName())) {
-                    continue;
-                }
-                try (BufferedInputStream inputStream =
-                        new BufferedInputStream(zip.getInputStream(zipEntry))) {
-                    data.add(analyze(jar, inputStream));
-                }
-            }
-        }
-        return data;
-    }
-
-    @NonNull
-    private static List<DesugaringData> analyzeDir(@NonNull Path dir) throws IOException {
-        Preconditions.checkArgument(Files.isDirectory(dir), "Not a directory: %s", dir.toString());
-
-        List<DesugaringData> data = new LinkedList<>();
-        Files.walkFileTree(
-                dir,
-                new SimpleFileVisitor<Path>() {
-                    @Override
-                    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
-                            throws IOException {
-                        Path relative = dir.relativize(file);
-                        if (ClassFileInput.CLASS_MATCHER.test(relative.toString())) {
-                            data.add(analyzeClass(file));
-                        }
-
-                        return super.visitFile(file, attrs);
-                    }
-                });
-        return data;
-    }
-
-    @NonNull
-    private static DesugaringData analyzeClass(@NonNull Path classFile) throws IOException {
-        Preconditions.checkArgument(
-                classFile.toString().endsWith(SdkConstants.DOT_CLASS)
-                        && Files.isRegularFile(classFile),
-                "Not a .class file: %s",
-                classFile.toString());
-
-        try (InputStream is = new BufferedInputStream(Files.newInputStream(classFile))) {
-            return analyze(classFile, is);
-        }
-    }
-
-    @NonNull
-    public static DesugaringData forRemoved(@NonNull Path path) {
-        Preconditions.checkArgument(!Files.exists(path), "%s exists.", path.toString());
-        return new DesugaringData(path);
-    }
-
-    @NonNull
-    @VisibleForTesting
-    static DesugaringData analyze(@NonNull Path path, @NonNull InputStream is) throws IOException {
-        ClassReader reader = new ClassReader(is);
-        Visitor visitor = new Visitor(path);
-        reader.accept(visitor, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
-
-        return new DesugaringData(visitor.getPath(), visitor.getType(), visitor.getDependencies());
-    }
-
-    private static class Visitor extends ClassVisitor {
-        @NonNull private final Path path;
-        private String type;
-        @NonNull private final Set<String> dependencies = Sets.newHashSet();
-
-        public Visitor(@NonNull Path path) {
-            super(Opcodes.ASM7);
-            this.path = path;
-        }
-
-        @NonNull
-        public Path getPath() {
-            return path;
-        }
-
-        @NonNull
-        public String getType() {
-            return Preconditions.checkNotNull(type, "visit() not invoked");
-        }
-
-        @NonNull
-        public Set<String> getDependencies() {
-            return dependencies;
-        }
-
-        @Override
-        public void visit(
-                int version,
-                int access,
-                String name,
-                String signature,
-                String superName,
-                String[] interfaces) {
-            type = name;
-            if (superName != null) {
-                // is is null for java/lang/Object
-                dependencies.add(superName);
-            }
-            if (interfaces != null) {
-                Collections.addAll(dependencies, interfaces);
-            }
-        }
-
-        @Override
-        public MethodVisitor visitMethod(
-                int access, String name, String desc, String signature, String[] exceptions) {
-            MethodVisitor methodVisitor =
-                    super.visitMethod(access, name, desc, signature, exceptions);
-
-            return new LambdaSeeker(dependencies, methodVisitor);
-        }
-
-        @Override
-        public void visitOuterClass(String owner, String name, String desc) {
-            // Add dependency to support nest-based access control - b/130578767.
-            // Invoked only for local/anonymous classes with EnclosingMethod attribute -
-            // https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7.7
-            if (owner != null) {
-                dependencies.add(owner);
-            }
-            super.visitOuterClass(owner, name, desc);
-        }
-
-        @Override
-        public void visitInnerClass(String name, String outerName, String innerName, int access) {
-            // Need inner class handling because of the nest-based access control - b/130578767.
-            if (type.equals(outerName)) {
-                // Name denotes an inner class enclosed by this type => depend on it.
-                dependencies.add(name);
-            } else if (type.equals(name)) {
-                // We are in an inner class, and outerName contains where it was declared if it is
-                // not null => depend on it. OuterName will be null for local/anonymous classes
-                if (outerName != null) {
-                    dependencies.add(outerName);
-                }
-            } else if (outerName == null) {
-                // Name is a non-member class => depend on it.
-                dependencies.add(name);
-            }
-            super.visitInnerClass(name, outerName, innerName, access);
-        }
-    }
-
-    private static class LambdaSeeker extends MethodVisitor {
-        @NonNull private final Set<String> dependencies;
-
-        public LambdaSeeker(@NonNull Set<String> dependencies, @NonNull MethodVisitor mv) {
-            super(Opcodes.ASM5, mv);
-            this.dependencies = dependencies;
-        }
-
-        @Override
-        public void visitInvokeDynamicInsn(
-                String name, String desc, Handle bsm, Object... bsmArgs) {
-            Type methodType = Type.getMethodType(desc);
-            String internalName = methodType.getReturnType().getInternalName();
-            dependencies.add(internalName);
-
-            super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
-        }
-    }
-}
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringData.java b/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringData.java
deleted file mode 100644
index 706ff07..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringData.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableSet;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Set;
-
-/**
- * This contains desugaring information for a single type, defined in a .class file or .jar whose
- * path is {@link #getPath()}. Combining {@link DesugaringData} for all runtime classes, we are able
- * to build the desugaring graph.
- *
- * <p>Information is produced by analyzing the class file that, and looking for all types in that
- * file that might impact desugaring of the class. Those are the following:
- *
- * <ul>
- *   <li>A direct superclass and all directly implemented interfaces.
- *   <li>For every lambda body defined in a class, type of the functional interface it implements.
- * </ul>
- *
- * <p>Please note that for the removed paths, {@link #isLive()} returns false.
- */
-public final class DesugaringData {
-    @NonNull private final Path path;
-    @Nullable private final String internalName;
-    @NonNull private final Set<String> dependencies;
-
-    DesugaringData(@NonNull Path path) {
-        this.path = path;
-        this.internalName = null;
-        this.dependencies = ImmutableSet.of();
-    }
-
-    DesugaringData(
-            @NonNull Path path, @NonNull String internalName, @NonNull Set<String> dependencies) {
-        this.path = path;
-        this.internalName = internalName;
-        this.dependencies = dependencies;
-    }
-
-    /** This can be either a jar or .class file defining the type. */
-    @NonNull
-    public Path getPath() {
-        return path;
-    }
-
-    boolean isLive() {
-        return Files.exists(path);
-    }
-
-    @NonNull
-    String getInternalName() {
-        return Preconditions.checkNotNull(internalName, "First check if isLive().");
-    }
-
-    @NonNull
-    Set<String> getDependencies() {
-        return dependencies;
-    }
-}
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraph.java b/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraph.java
deleted file mode 100644
index d6b64d2..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraph.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Class that keeps track of desugaring dependencies. Main goal of this class is to provide a set of
- * paths that should be reprocessed, in addition to the set of class files whose content has
- * changed.
- *
- * <p>It is built by combining {@link DesugaringData}, local desugaring dependencies, for all paths
- * that are relevant. Once all data is added, for a path, a dependent set of paths can be calculated
- * by traversing the graph in the following way:
- *
- * <ul>
- *   <li>For the input path, get all types it contains. For .class file this will be a single type,
- *       for .jar it will be multiple.
- *   <li>For every type T, from the previous step, find the set of dependent types. These are the
- *       types whose desugaring output depends on T.
- *   <li>Once the set of dependent types is known, paths that define them are found, and that is the
- *       resulting set of paths.
- * </ul>
- */
-public class DesugaringGraph {
-    @NonNull
-    public static final DesugaringGraph EMPTY =
-            new DesugaringGraph(Collections.emptyList()) {
-                @Override
-                public void update(@NonNull Collection<DesugaringData> data) {
-                    throw new AssertionError();
-                }
-
-                @NonNull
-                @Override
-                public Set<Path> getDependentPaths(@NonNull Path path) {
-                    return ImmutableSet.of();
-                }
-            };
-
-    @NonNull private final TypeDependencies typeDependencies;
-    @NonNull private final TypePaths typePaths;
-
-    DesugaringGraph(@NonNull Collection<DesugaringData> data) {
-        typeDependencies = new TypeDependencies();
-        typePaths = new TypePaths();
-
-        for (DesugaringData d : data) {
-            typeDependencies.add(d.getInternalName(), d.getDependencies());
-            typePaths.add(d.getPath(), d.getInternalName());
-        }
-    }
-
-    /** Initializes or updates the graph with the new data. */
-    public void update(@NonNull Collection<DesugaringData> data) {
-        removeItems(data);
-        insertLiveItems(data);
-    }
-
-    /** Returns a set of paths the given path is depending on. */
-    @NonNull
-    public Set<Path> getDependenciesPaths(@NonNull Path path) {
-        Set<String> types = typePaths.getTypes(path);
-
-        Set<String> impactedTypes = Sets.newHashSet();
-        for (String type : types) {
-            impactedTypes.addAll(typeDependencies.getAllDependencies(type));
-        }
-
-        Set<Path> impactedPaths = Sets.newHashSetWithExpectedSize(impactedTypes.size());
-        for (String impactedType : impactedTypes) {
-            impactedPaths.addAll(typePaths.getPaths(impactedType));
-        }
-        impactedPaths.remove(path);
-        return impactedPaths;
-    }
-
-    /**
-     * Returns a set of paths that should be additionally processed, based on the changed input
-     * path.
-     */
-    @NonNull
-    public Set<Path> getDependentPaths(@NonNull Path path) {
-        Set<String> types = typePaths.getTypes(path);
-
-        Set<String> impactedTypes = Sets.newHashSet();
-        for (String type : types) {
-            impactedTypes.addAll(typeDependencies.getAllDependents(type));
-        }
-
-        Set<Path> impactedPaths = Sets.newHashSetWithExpectedSize(impactedTypes.size());
-        for (String impactedType : impactedTypes) {
-            impactedPaths.addAll(typePaths.getPaths(impactedType));
-        }
-        impactedPaths.remove(path);
-        return impactedPaths;
-    }
-
-    @VisibleForTesting
-    @NonNull
-    Set<String> getDependents(@NonNull String type) {
-        return typeDependencies.getDependents(type);
-    }
-
-    @VisibleForTesting
-    @NonNull
-    Set<String> getDependencies(@NonNull String type) {
-        return typeDependencies.getDependencies(type);
-    }
-
-    @VisibleForTesting
-    @NonNull
-    Set<String> getAllDependentTypes(@NonNull String type) {
-        return typeDependencies.getAllDependents(type);
-    }
-
-    private void removeItems(@NonNull Collection<DesugaringData> data) {
-        Set<Path> modifiedPaths =
-                data.stream().map(DesugaringData::getPath).collect(Collectors.toSet());
-
-        for (DesugaringData d : data) {
-            Set<String> typesInPath = typePaths.remove(d.getPath(), modifiedPaths);
-            if (typesInPath == null) {
-                continue;
-            }
-
-            for (String removedType : typesInPath) {
-                typeDependencies.remove(removedType);
-            }
-        }
-    }
-
-    private void insertLiveItems(@NonNull Collection<DesugaringData> data) {
-        for (DesugaringData d : data) {
-            if (!d.isLive()) {
-                continue;
-            }
-
-            typePaths.add(d.getPath(), d.getInternalName());
-            typeDependencies.add(d.getInternalName(), d.getDependencies());
-        }
-    }
-}
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraphs.java b/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraphs.java
deleted file mode 100644
index 3aad8ef..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/DesugaringGraphs.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.annotations.NonNull;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import java.util.Collection;
-import java.util.function.Supplier;
-
-/**
- * Factory class for {@link com.android.builder.desugaring.DesugaringGraph}. This is the only way to
- * create {@link DesugaringGraph} as we would like to cache them between runs.
- */
-public final class DesugaringGraphs {
-
-    @NonNull
-    static Cache<String, DesugaringGraph> graphs = CacheBuilder.newBuilder().maximumSize(4).build();
-
-    private DesugaringGraphs() {}
-
-    /**
-     * Get a {@link com.android.builder.desugaring.DesugaringGraph} associated with this key. Key
-     * should be unique for the project and variant e.g. :app:debug. If the graph does not exist, it
-     * is created from the supplied data.
-     */
-    @NonNull
-    public static DesugaringGraph forVariant(
-            @NonNull String projectVariant,
-            @NonNull Supplier<Collection<DesugaringData>> ifFull,
-            @NonNull Supplier<Collection<DesugaringData>> ifIncremental) {
-        DesugaringGraph graph = graphs.getIfPresent(projectVariant);
-        if (graph != null) {
-            graph.update(ifIncremental.get());
-        } else {
-            graph = new DesugaringGraph(ifFull.get());
-            graphs.put(projectVariant, graph);
-        }
-        return graph;
-    }
-
-    /**
-     * Create a {@link com.android.builder.desugaring.DesugaringGraph} associated with this key. Key
-     * should be unique for the project and variant e.g. :app:debug. The graph is created fully from
-     * the supplied data.
-     */
-    @NonNull
-    public static DesugaringGraph forVariant(
-            @NonNull String projectVariant,
-            @NonNull Collection<DesugaringData> fullDesugaringData) {
-        DesugaringGraph graph = new DesugaringGraph(fullDesugaringData);
-        graphs.put(projectVariant, graph);
-        return graph;
-    }
-
-    /**
-     * Update a {@link com.android.builder.desugaring.DesugaringGraph} associated with this key if a
-     * cached version exists. Key should be unique for the project and variant e.g. :app:debug. Does
-     * nothing if no cached version exists for the variant.
-     */
-    @NonNull
-    public static DesugaringGraph updateVariant(
-            @NonNull String projectVariant,
-            @NonNull Supplier<Collection<DesugaringData>> incrementalDesugaringData) {
-        DesugaringGraph graph = graphs.getIfPresent(projectVariant);
-        if (graph != null) {
-            graph.update(incrementalDesugaringData.get());
-        }
-        return graph;
-    }
-
-    /** Removes the desugaring graph for the specified project variant. */
-    public static void invalidate(@NonNull String projectVariant) {
-        graphs.invalidate(projectVariant);
-    }
-}
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/TypeDependencies.java b/build-system/builder/src/main/java/com/android/builder/desugaring/TypeDependencies.java
deleted file mode 100644
index df264bb..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/TypeDependencies.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.annotations.NonNull;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import java.util.ArrayDeque;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Function;
-
-/**
- * Keeps track of the type desugaring dependencies. This is required in order to determine a set of
- * types that might need to be reprocessed if some type changes.
- *
- * <p>For every type T, this class can calculate set of types whose desugaring depends on T, by
- * following transitive dependencies between types.
- *
- * <p>For details when a dependency between two types exists, see {@link DesugaringData}.
- */
-final class TypeDependencies {
-    /** Map from type to types it depends on in the desugaring process. */
-    @NonNull private final Map<String, Set<String>> typeToDependencies = Maps.newHashMap();
-    /**
-     * Map from type to types that depend on it in the desugaring process. This field should be
-     * accessed only using {@link #reverseMapping()}.
-     */
-    @NonNull private final Map<String, Set<String>> typeToDependents = Maps.newHashMap();
-
-    boolean isReverseMappingValid = false;
-
-    void add(@NonNull String dependent, @NonNull Set<String> dependencies) {
-        Set<String> myDependencies = typeToDependencies.getOrDefault(dependent, new HashSet<>());
-        myDependencies.addAll(dependencies);
-        typeToDependencies.put(dependent, myDependencies);
-        invalidateReverseMapping();
-    }
-
-    @NonNull
-    Set<String> getDependencies(@NonNull String type) {
-        return typeToDependencies.getOrDefault(type, ImmutableSet.of());
-    }
-
-    @NonNull
-    Set<String> getDependents(@NonNull String type) {
-        return reverseMapping().getOrDefault(type, ImmutableSet.of());
-    }
-
-    @NonNull
-    Set<String> getAllDependents(@NonNull String type) {
-        return collectNeighbours(type, this::getDependents);
-    }
-
-    @NonNull
-    Set<String> getAllDependencies(@NonNull String type) {
-        return collectNeighbours(type, this::getDependencies);
-    }
-
-    /**
-     * Transitively collect neighbours of {@code start} node in a graph.
-     *
-     * @param start Start node.
-     * @param getNeighbours A function giving the neighbours of a node.
-     * @return all nodes having a direct or indirect neighbour relation from {@code start} node.
-     *     This does not include {@code start} node.
-     */
-    private static Set<String> collectNeighbours(
-            @NonNull String start, @NonNull Function<String, Set<String>> getNeighbours) {
-        // BFS traversal: we start from start, traverse all of its neighbours, then neighbours of
-        // its neighbours, and so on.
-        Set<String> children = Sets.newHashSet();
-
-        ArrayDeque<String> dequeue = new ArrayDeque<>();
-        dequeue.add(start);
-
-        while (!dequeue.isEmpty()) {
-            String current = dequeue.removeFirst();
-
-            Set<String> neighbours = getNeighbours.apply(current);
-            for (String neighbour : neighbours) {
-                if ((!neighbour.equals(start)) && children.add(neighbour)) {
-                    dequeue.addLast(neighbour);
-                }
-            }
-        }
-
-        return children;
-
-    }
-
-    private void invalidateReverseMapping() {
-        isReverseMappingValid = false;
-    }
-
-    @NonNull
-    private Map<String, Set<String>> reverseMapping() {
-        if (isReverseMappingValid) {
-            return typeToDependents;
-        }
-
-        typeToDependents.clear();
-        for (Map.Entry<String, Set<String>> typeToDeps : typeToDependencies.entrySet()) {
-            for (String dependency : typeToDeps.getValue()) {
-                Set<String> myDependents =
-                        typeToDependents.getOrDefault(dependency, Sets.newHashSet());
-                myDependents.add(typeToDeps.getKey());
-                this.typeToDependents.put(dependency, myDependents);
-            }
-        }
-
-        isReverseMappingValid = true;
-        return typeToDependents;
-    }
-
-    void remove(@NonNull String removedType) {
-        typeToDependencies.remove(removedType);
-        invalidateReverseMapping();
-    }
-}
diff --git a/build-system/builder/src/main/java/com/android/builder/desugaring/TypePaths.java b/build-system/builder/src/main/java/com/android/builder/desugaring/TypePaths.java
deleted file mode 100644
index 19309eb..0000000
--- a/build-system/builder/src/main/java/com/android/builder/desugaring/TypePaths.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import java.nio.file.Path;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Keeps track of types, and paths that define them.
- *
- * <p>For a type, it returns paths that define it. Typically, there is only a single path, but there
- * might be multiple.
- *
- * <p>For a path, it returns a set of types that it defines. In case of a .class file, this will be
- * a single type, but for a .jar, there are multiple.
- */
-final class TypePaths {
-    /**
-     * Map from path to types defined in that path. For jars this is list of types in that jar, for
-     * class files, this is a single type.
-     */
-    @NonNull private final Map<Path, Set<String>> pathToTypes = Maps.newHashMap();
-    /**
-     * Map from type to paths defining that type. Each type should be defined only in one file, but
-     * there is no mechanism to enforce that. This field should be accessed only using {@link
-     * #reverseMapping()}.
-     */
-    @NonNull private final Map<String, Set<Path>> typeToPaths = Maps.newHashMap();
-
-    boolean isReverseMappingValid = false;
-
-    void add(@NonNull Path path, @NonNull String internalName) {
-        Set<String> types = pathToTypes.getOrDefault(path, getNewSetForPath(path));
-        types.add(internalName);
-        pathToTypes.put(path, types);
-
-        invalidateReverseMapping();
-    }
-
-    @NonNull
-    Set<String> getTypes(@NonNull Path path) {
-        return pathToTypes.getOrDefault(path, ImmutableSet.of());
-    }
-
-    /**
-     * Remove path information, and a list of types that should be removed. Not all types defined in
-     * a path will be removed, as a single type might be defined in multiple paths.
-     */
-    @Nullable
-    Set<String> remove(@NonNull Path path, @NonNull Set<Path> removedPaths) {
-        Set<String> allInPath = pathToTypes.remove(path);
-        if (allInPath == null) {
-            return ImmutableSet.of();
-        }
-
-        invalidateReverseMapping();
-
-        Set<String> toRemove = new HashSet<>(allInPath.size());
-        for (String type : allInPath) {
-            Set<Path> definedInPaths = getPaths(type);
-            if (Sets.difference(definedInPaths, removedPaths).isEmpty()) {
-                // all paths containing this type have been removed
-                toRemove.add(type);
-            }
-        }
-
-        return toRemove;
-    }
-
-    @NonNull
-    Set<Path> getPaths(@NonNull String internalName) {
-        return reverseMapping().getOrDefault(internalName, ImmutableSet.of());
-    }
-
-    private void invalidateReverseMapping() {
-        isReverseMappingValid = false;
-    }
-
-    @NonNull
-    private Map<String, Set<Path>> reverseMapping() {
-        if (isReverseMappingValid) {
-            return typeToPaths;
-        }
-
-        typeToPaths.clear();
-        for (Map.Entry<Path, Set<String>> pathToType : pathToTypes.entrySet()) {
-            for (String type : pathToType.getValue()) {
-                Set<Path> paths =
-                        typeToPaths.getOrDefault(type, Sets.newHashSetWithExpectedSize(1));
-                paths.add(pathToType.getKey());
-
-                typeToPaths.put(type, paths);
-            }
-        }
-        isReverseMappingValid = true;
-        return typeToPaths;
-    }
-
-    @NonNull
-    private static Set<String> getNewSetForPath(@NonNull Path path) {
-        if (path.toString().endsWith(SdkConstants.DOT_CLASS)) {
-            return Sets.newHashSetWithExpectedSize(1);
-        } else {
-            return Sets.newHashSet();
-        }
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/DesugaringClassAnalyzerTest.java b/build-system/builder/src/test/java/com/android/builder/desugaring/DesugaringClassAnalyzerTest.java
deleted file mode 100644
index 2b1c387..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/DesugaringClassAnalyzerTest.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.builder.desugaring.samples.BaseInterface;
-import com.android.builder.desugaring.samples.ClassLambdaInParam;
-import com.android.builder.desugaring.samples.ClassSuperClassAndInterface;
-import com.android.builder.desugaring.samples.FunInterface;
-import com.android.builder.desugaring.samples.FunInterfaceSubtype;
-import com.android.builder.desugaring.samples.LambdaClass;
-import com.android.builder.desugaring.samples.LambdaOfSubtype;
-import com.android.builder.desugaring.samples.OuterClass;
-import com.android.builder.desugaring.samples.SampleClass;
-import com.android.builder.desugaring.samples.SampleInterface;
-import com.android.testutils.TestInputsGenerator;
-import com.android.utils.Pair;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.objectweb.asm.Type;
-
-/** Tests for the desugaring dependencies analysis. */
-public class DesugaringClassAnalyzerTest {
-
-    @Rule public TemporaryFolder tmp = new TemporaryFolder();
-
-    @Test
-    public void testBaseInterface() throws IOException {
-        DesugaringGraph graph = analyze(BaseInterface.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(Object.class, ImmutableSet.of(BaseInterface.class)), graph);
-        assertFullDependentGraph(Object.class, ImmutableSet.of(BaseInterface.class), graph);
-        assertFullDependenciesGraph(BaseInterface.class, ImmutableSet.of(), graph);
-    }
-
-    @Test
-    public void testClassImplementingInterface() throws IOException {
-        DesugaringGraph graph =
-                analyze(BaseInterface.class, SampleInterface.class, SampleClass.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(
-                        Object.class,
-                                ImmutableSet.of(
-                                        BaseInterface.class,
-                                        SampleInterface.class,
-                                        SampleClass.class),
-                        BaseInterface.class, ImmutableSet.of(SampleInterface.class),
-                        SampleInterface.class, ImmutableSet.of(SampleClass.class)),
-                graph);
-
-        assertFullDependentGraph(
-                Object.class,
-                ImmutableSet.of(BaseInterface.class, SampleInterface.class, SampleClass.class),
-                graph);
-        assertFullDependentGraph(
-                BaseInterface.class,
-                ImmutableSet.of(SampleInterface.class, SampleClass.class),
-                graph);
-        assertFullDependenciesGraph(
-                SampleInterface.class, ImmutableSet.of(BaseInterface.class), graph);
-    }
-
-    @Test
-    public void testSubClassAndLambda() throws IOException {
-        DesugaringGraph graph =
-                analyze(
-                        SampleClass.class,
-                        LambdaClass.class,
-                        FunInterface.class,
-                        SampleInterface.class,
-                        BaseInterface.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(
-                        Object.class,
-                                ImmutableSet.of(
-                                        FunInterface.class,
-                                        SampleClass.class,
-                                        SampleInterface.class,
-                                        BaseInterface.class),
-                        SampleClass.class, ImmutableSet.of(LambdaClass.class),
-                        FunInterface.class, ImmutableSet.of(LambdaClass.class),
-                        SampleInterface.class, ImmutableSet.of(SampleClass.class),
-                        BaseInterface.class, ImmutableSet.of(SampleInterface.class)),
-                graph);
-        assertFullDependentGraph(SampleClass.class, ImmutableSet.of(LambdaClass.class), graph);
-        assertFullDependentGraph(LambdaClass.class, ImmutableSet.of(), graph);
-        assertFullDependenciesGraph(
-                SampleClass.class,
-                ImmutableSet.of(SampleInterface.class, BaseInterface.class),
-                graph);
-        assertFullDependenciesGraph(
-                LambdaClass.class,
-                ImmutableSet.of(
-                        SampleClass.class,
-                        SampleInterface.class,
-                        BaseInterface.class,
-                        FunInterface.class),
-                graph);
-    }
-
-    @Test
-    public void testLambdaOfSubtype() throws IOException {
-        DesugaringGraph graph =
-                analyze(LambdaOfSubtype.class, FunInterface.class, FunInterfaceSubtype.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(
-                        Object.class,
-                                ImmutableSet.of(
-                                        FunInterface.class,
-                                        LambdaOfSubtype.class,
-                                        FunInterfaceSubtype.class),
-                        FunInterface.class, ImmutableSet.of(FunInterfaceSubtype.class),
-                        FunInterfaceSubtype.class, ImmutableSet.of(LambdaOfSubtype.class)),
-                graph);
-        assertFullDependentGraph(
-                FunInterface.class,
-                ImmutableSet.of(FunInterfaceSubtype.class, LambdaOfSubtype.class),
-                graph);
-        assertFullDependenciesGraph(
-                LambdaOfSubtype.class,
-                ImmutableSet.of(FunInterface.class, FunInterfaceSubtype.class),
-                graph);
-    }
-
-    @Test
-    public void testClassHasSuperClassAndSuperInterface() throws IOException {
-        DesugaringGraph graph =
-                analyze(ClassSuperClassAndInterface.class, SampleClass.class, BaseInterface.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(
-                        SampleClass.class, ImmutableSet.of(ClassSuperClassAndInterface.class),
-                        BaseInterface.class, ImmutableSet.of(ClassSuperClassAndInterface.class)),
-                graph);
-        assertFullDependentGraph(
-                BaseInterface.class, ImmutableSet.of(ClassSuperClassAndInterface.class), graph);
-    }
-
-    @Test
-    public void testClassWithLambdaInParams() throws IOException {
-        DesugaringGraph graph = analyze(ClassLambdaInParam.class);
-
-        assertDirectDependencyGraph(
-                ImmutableMap.of(
-                        Object.class, ImmutableSet.of(ClassLambdaInParam.class),
-                        FunInterfaceSubtype.class, ImmutableSet.of(ClassLambdaInParam.class)),
-                graph);
-    }
-
-    @Test
-    public void testModuleInfoSkipped() throws IOException {
-        Path inputDir = tmp.newFolder().toPath();
-        Files.createFile(inputDir.resolve("module-info.class"));
-        List<DesugaringData> analyze = DesugaringClassAnalyzer.analyze(inputDir);
-        assertThat(analyze).isEmpty();
-    }
-
-    @Test
-    public void testNestBasedAccessControl() throws IOException, ClassNotFoundException {
-        // We cannot access type, but javac generates stable name OuterClass$1MethodInner.
-        Class<?> methodLocalClass =
-                this.getClass()
-                        .getClassLoader()
-                        .loadClass(OuterClass.class.getName() + "$1MethodInner");
-        Class<?> methodAnonymousClass =
-                this.getClass().getClassLoader().loadClass(OuterClass.class.getName() + "$1");
-
-        DesugaringGraph graph =
-                analyze(
-                        OuterClass.class,
-                        OuterClass.Inner.class,
-                        OuterClass.Inner.DoubleInner.class,
-                        OuterClass.InnerStatic.class,
-                        methodLocalClass,
-                        methodAnonymousClass);
-
-        ImmutableMap.Builder<Class<?>, Set<Class<?>>> directDependencies = ImmutableMap.builder();
-        directDependencies.put(
-                Object.class,
-                ImmutableSet.of(
-                        OuterClass.class,
-                        OuterClass.Inner.class,
-                        OuterClass.Inner.DoubleInner.class,
-                        OuterClass.InnerStatic.class,
-                        methodLocalClass,
-                        methodAnonymousClass));
-        directDependencies.put(
-                OuterClass.class,
-                ImmutableSet.of(
-                        OuterClass.Inner.class,
-                        OuterClass.InnerStatic.class,
-                        methodLocalClass,
-                        methodAnonymousClass));
-        directDependencies.put(
-                OuterClass.Inner.class,
-                ImmutableSet.of(OuterClass.class, OuterClass.Inner.DoubleInner.class));
-        directDependencies.put(
-                OuterClass.Inner.DoubleInner.class, ImmutableSet.of(OuterClass.Inner.class));
-        directDependencies.put(OuterClass.InnerStatic.class, ImmutableSet.of(OuterClass.class));
-        directDependencies.put(methodLocalClass, ImmutableSet.of(OuterClass.class));
-        directDependencies.put(methodAnonymousClass, ImmutableSet.of(OuterClass.class));
-
-        assertDirectDependencyGraph(directDependencies.build(), graph);
-
-        // Every class depends on every other.
-        ImmutableSet<Class<?>> allClasses =
-                ImmutableSet.of(
-                        OuterClass.class,
-                        OuterClass.Inner.class,
-                        OuterClass.Inner.DoubleInner.class,
-                        OuterClass.InnerStatic.class,
-                        methodLocalClass,
-                        methodAnonymousClass);
-        for (Class<?> clazz : allClasses) {
-            Sets.SetView<Class<?>> allOtherClasses =
-                    Sets.difference(allClasses, Collections.singleton(clazz));
-            assertFullDependentGraph(clazz, allOtherClasses, graph);
-        }
-    }
-
-    /** Regression test for b/137488460, the analyzer should ignore invalid entries in jars. */
-    @Test
-    public void testIgnoreInvalidZipEntry() throws Exception {
-        Path jarWithInvalidEntry = tmp.newFolder().toPath().resolve("invalidEntry.jar");
-        //noinspection unchecked: Generics in vararg are unchecked.
-        TestInputsGenerator.writeJarWithTextEntries(
-                jarWithInvalidEntry, Pair.of("../invalid", "ignore"));
-        List<DesugaringData> result = DesugaringClassAnalyzer.analyze(jarWithInvalidEntry);
-        assertThat(result).isEmpty();
-    }
-
-    @NonNull
-    private DesugaringGraph analyze(@NonNull Class<?>... classes) throws IOException {
-        Set<DesugaringData> data = Sets.newHashSet();
-        for (Class<?> klass : classes) {
-            try (InputStream is = getClassInput(klass)) {
-                data.add(DesugaringClassAnalyzer.analyze(getPath(klass), is));
-            }
-        }
-        return new DesugaringGraph(data);
-    }
-
-    private void assertDirectDependencyGraph(
-            @NonNull Map<Class<?>, Set<Class<?>>> ownerToDependents,
-            @NonNull DesugaringGraph graph) {
-        for (Class<?> owner : ownerToDependents.keySet()) {
-            Set<String> internalNames =
-                    ownerToDependents
-                            .get(owner)
-                            .stream()
-                            .map(this::internal)
-                            .collect(Collectors.toSet());
-
-            assertThat(graph.getDependents(internal(owner)))
-                    .named("direct dependents of " + owner.getName())
-                    .containsExactlyElementsIn(internalNames);
-        }
-
-        // now confirm reverse lookup
-        Map<Class<?>, Set<Class<?>>> depToOwners = Maps.newHashMap();
-        for (Map.Entry<Class<?>, Set<Class<?>>> ownerAndDeps : ownerToDependents.entrySet()) {
-            for (Class<?> dep : ownerAndDeps.getValue()) {
-                Set<Class<?>> owners = depToOwners.getOrDefault(dep, Sets.newHashSet());
-                owners.add(ownerAndDeps.getKey());
-                depToOwners.put(dep, owners);
-            }
-        }
-
-        for (Class<?> dep : depToOwners.keySet()) {
-            Set<String> internalNames =
-                    depToOwners.get(dep).stream().map(this::internal).collect(Collectors.toSet());
-
-            assertThat(graph.getDependencies(internal(dep)))
-                    .named("direct owners of " + dep.getName())
-                    .containsExactlyElementsIn(internalNames);
-        }
-    }
-
-    private void assertFullDependentGraph(
-            @NonNull Class<?> owner,
-            @NonNull Collection<Class<?>> dependents,
-            @NonNull DesugaringGraph graph) {
-        Set<String> internalNames =
-                dependents.stream().map(this::internal).collect(Collectors.toSet());
-        assertThat(graph.getAllDependentTypes(internal(owner)))
-                .named("Full list of classes depending on " + owner.getName())
-                .containsExactlyElementsIn(internalNames);
-
-        if (!owner.equals(Object.class)) {
-            Set<Path> dependenciesPaths =
-                    dependents
-                            .stream()
-                            .filter(clazz -> !clazz.equals(Object.class))
-                            .map(this::getPath)
-                            .collect(Collectors.toSet());
-            assertThat(graph.getDependentPaths(getPath(owner)))
-                    .named("Full list of path depending on " + owner.getName())
-                    .containsExactlyElementsIn(dependenciesPaths);
-        }
-    }
-
-    private void assertFullDependenciesGraph(
-            @NonNull Class<?> owner,
-            @NonNull Collection<Class<?>> dependencies,
-            @NonNull DesugaringGraph graph) {
-
-        Set<Path> dependentPaths =
-                dependencies
-                        .stream()
-                        .filter(clazz -> !clazz.equals(Object.class))
-                        .map(this::getPath)
-                        .collect(Collectors.toSet());
-        assertThat(graph.getDependenciesPaths(getPath(owner)))
-                .named("Full list of path " + owner.getName() + " is depending on")
-                .containsExactlyElementsIn(dependentPaths);
-    }
-
-    @NonNull
-    private InputStream getClassInput(Class<?> klass) {
-        return this.getClass()
-                .getClassLoader()
-                .getResourceAsStream(internal(klass) + SdkConstants.DOT_CLASS);
-    }
-
-    @NonNull
-    private String internal(@NonNull Class<?> klass) {
-        return Type.getInternalName(klass);
-    }
-
-    @NonNull
-    private Path getPath(@NonNull Class<?> klass) {
-        return Paths.get(internal(klass));
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/BaseInterface.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/BaseInterface.java
deleted file mode 100644
index 6878170..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/BaseInterface.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** An empty interface. */
-public interface BaseInterface {}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassLambdaInParam.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassLambdaInParam.java
deleted file mode 100644
index 02dce11..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassLambdaInParam.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Class with lambda body directly in parameters. */
-public class ClassLambdaInParam {
-    private void foo(FunInterfaceSubtype f) {}
-
-    private void lambdaBody() {
-        foo(() -> {});
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassSuperClassAndInterface.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassSuperClassAndInterface.java
deleted file mode 100644
index 0a42c31..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/ClassSuperClassAndInterface.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Class with explicit superclass and interfaces. */
-public class ClassSuperClassAndInterface extends SampleClass implements BaseInterface {}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterface.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterface.java
deleted file mode 100644
index f9bd936..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterface.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Functional interface. */
-public interface FunInterface {
-    void fun();
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterfaceSubtype.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterfaceSubtype.java
deleted file mode 100644
index 43dc24e..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/FunInterfaceSubtype.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Interface extending a functional interface. */
-public interface FunInterfaceSubtype extends FunInterface {}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaClass.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaClass.java
deleted file mode 100644
index 0ddafb5..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaClass.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Class defining a lambda implementing a functional interface. */
-public class LambdaClass extends SampleClass {
-    static {
-        FunInterface iface = () -> {};
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaOfSubtype.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaOfSubtype.java
deleted file mode 100644
index 884a1f7..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/LambdaOfSubtype.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Class defining a lambda which type is a sub-interface of the functional interface. */
-public class LambdaOfSubtype {
-    private void acceptLambda(FunInterface i) {}
-
-    private void createLambda() {
-        FunInterfaceSubtype subtype = () -> {};
-        acceptLambda(subtype);
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/OuterClass.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/OuterClass.java
deleted file mode 100644
index 74b9f72..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/OuterClass.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-@SuppressWarnings("all") // Used in incremental desugaring test
-public class OuterClass {
-    public class Inner {
-        public class DoubleInner {}
-    }
-
-    public static class InnerStatic {}
-
-    void foo() {
-        class MethodInner {}
-        new Object() {
-            public String toString() {
-                return super.toString();
-            }
-        };
-    }
-}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleClass.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleClass.java
deleted file mode 100644
index f8e1218..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleClass.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Class extending an interface. */
-public class SampleClass implements SampleInterface {}
diff --git a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleInterface.java b/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleInterface.java
deleted file mode 100644
index 780860f..0000000
--- a/build-system/builder/src/test/java/com/android/builder/desugaring/samples/SampleInterface.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.builder.desugaring.samples;
-
-/** Interface extending an interface. */
-public interface SampleInterface extends BaseInterface {}
diff --git a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelper.java b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelper.java
deleted file mode 100644
index 37a15d2..0000000
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelper.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.build.gradle.internal.tasks;
-
-import static com.android.builder.desugaring.DesugaringClassAnalyzer.analyze;
-
-import com.android.annotations.NonNull;
-import com.android.build.gradle.internal.LoggerWrapper;
-import com.android.builder.desugaring.DesugaringClassAnalyzer;
-import com.android.builder.desugaring.DesugaringData;
-import com.android.builder.desugaring.DesugaringGraph;
-import com.android.builder.desugaring.DesugaringGraphs;
-import com.android.ide.common.internal.WaitableExecutor;
-
-import com.google.common.base.Stopwatch;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-
-/**
- * This helper analyzes the task inputs, updates the {@link DesugaringGraph} it owns, and its
- * main goal is to provide paths that should also be considered out of date, in addition to the
- * changed files. See {@link #getAdditionalPaths()} for details.
- */
-public class DesugarIncrementalHelper {
-
-    @NonNull
-    private static final LoggerWrapper logger =
-            LoggerWrapper.getLogger(DesugarIncrementalHelper.class);
-
-    @NonNull private final String projectVariant;
-    @NonNull private final Iterable<Path> allInputs;
-    @NonNull private final WaitableExecutor executor;
-
-    @NonNull private final Supplier<Set<Path>> changedPaths;
-
-    @NonNull private final Supplier<DesugaringGraph> desugaringGraph;
-    private final boolean isIncremental;
-
-    public DesugarIncrementalHelper(
-            @NonNull String projectVariant,
-            boolean isIncremental,
-            @NonNull Iterable<File> allInputs,
-            @NonNull Supplier<Set<Path>> changedPaths,
-            @NonNull WaitableExecutor executor) {
-        this.projectVariant = projectVariant;
-        this.isIncremental = isIncremental;
-        this.allInputs = Iterables.transform(allInputs, File::toPath);
-        this.executor = executor;
-        this.changedPaths = Suppliers.memoize(changedPaths::get);
-        DesugaringGraph graph;
-        if (!isIncremental) {
-            DesugaringGraphs.invalidate(projectVariant);
-            graph = null;
-        } else {
-            graph =
-                    DesugaringGraphs.updateVariant(
-                            projectVariant, () -> getIncrementalData(changedPaths, executor));
-        }
-        desugaringGraph =
-                graph != null ? () -> graph : Suppliers.memoize(this::makeDesugaringGraph);
-    }
-
-    /**
-     * Get the list of paths that should be re-desugared, and update the dependency graph.
-     *
-     * <p>For full builds, graph will be invalidated. No additional paths to process are returned,
-     * as all inputs are considered out-of-date, and will be re-processed.
-     *
-     * <p>In incremental builds, graph will be initialized (if not already), or updated
-     * incrementally. Once it has been populated, set of changed files is analyzed, and all
-     * impacted, non-changed, paths will be returned as a result.
-     */
-    @NonNull
-    public Set<Path> getAdditionalPaths() {
-        if (!isIncremental) {
-            return ImmutableSet.of();
-        }
-
-        Stopwatch stopwatch = Stopwatch.createStarted();
-        logger.verbose("Desugaring dependencies incrementally.");
-
-        Set<Path> additionalPaths = new HashSet<>();
-        for (Path changed : changedPaths.get()) {
-            for (Path path : desugaringGraph.get().getDependentPaths(changed)) {
-                if (!changedPaths.get().contains(path)) {
-                    additionalPaths.add(path);
-                }
-            }
-        }
-
-        logger.verbose(
-                "Time to calculate desugaring dependencies: %d",
-                stopwatch.elapsed(TimeUnit.MILLISECONDS));
-        logger.verbose("Additional paths to desugar: %s", additionalPaths.toString());
-        return additionalPaths;
-    }
-
-    @NonNull
-    private DesugaringGraph makeDesugaringGraph() {
-        if (!isIncremental) {
-            // Rebuild totally the graph whatever the cache status
-            return DesugaringGraphs.forVariant(
-                    projectVariant, getInitalGraphData(allInputs, executor));
-        }
-        return DesugaringGraphs.forVariant(
-                projectVariant,
-                () -> getInitalGraphData(allInputs, executor),
-                () -> getIncrementalData(changedPaths, executor));
-    }
-
-    @NonNull
-    private static Collection<DesugaringData> getInitalGraphData(
-            @NonNull Iterable<Path> allInputs, @NonNull WaitableExecutor executor) {
-        Set<DesugaringData> data = Sets.newConcurrentHashSet();
-
-        for (Path input : allInputs) {
-            executor.execute(
-                    () -> {
-                        try {
-                            if (Files.exists(input)) {
-                                data.addAll(analyze(input));
-                            }
-                            return null;
-                        } catch (Throwable t) {
-                            logger.error(t, "error processing %s", input);
-                            throw t;
-                        }
-                    });
-        }
-
-        try {
-            executor.waitForTasksWithQuickFail(true);
-        } catch (InterruptedException e) {
-            throw new RuntimeException("Unable to get desugaring graph", e);
-        }
-
-        return data;
-    }
-
-    @NonNull
-    private static Set<DesugaringData> getIncrementalData(
-            @NonNull Supplier<Set<Path>> changedPaths, @NonNull WaitableExecutor executor) {
-        Set<DesugaringData> data = Sets.newConcurrentHashSet();
-        for (Path input : changedPaths.get()) {
-            if (Files.notExists(input)) {
-                data.add(DesugaringClassAnalyzer.forRemoved(input));
-            } else {
-                executor.execute(
-                        () -> {
-                            try {
-                                data.addAll(analyze(input));
-                                return null;
-                            } catch (Throwable t) {
-                                logger.error(t, "error processing %s", input);
-                                throw t;
-                            }
-                        });
-            }
-        }
-
-        try {
-            executor.waitForTasksWithQuickFail(true);
-        } catch (InterruptedException e) {
-            throw new RuntimeException("Unable to get desugaring graph", e);
-        }
-        return data;
-    }
-
-    public Set<Path> getDependenciesPaths(Path path) {
-        return desugaringGraph.get().getDependenciesPaths(path);
-    }
-}
diff --git a/build-system/gradle-core/src/test/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelperTest.java b/build-system/gradle-core/src/test/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelperTest.java
deleted file mode 100644
index 6370536..0000000
--- a/build-system/gradle-core/src/test/java/com/android/build/gradle/internal/tasks/DesugarIncrementalHelperTest.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.build.gradle.internal.tasks;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import com.android.annotations.NonNull;
-import com.android.build.gradle.internal.transforms.testdata.Animal;
-import com.android.build.gradle.internal.transforms.testdata.CarbonForm;
-import com.android.build.gradle.internal.transforms.testdata.Cat;
-import com.android.build.gradle.internal.transforms.testdata.Tiger;
-import com.android.build.gradle.internal.transforms.testdata.Toy;
-import com.android.ide.common.internal.WaitableExecutor;
-import com.android.testutils.TestInputsGenerator;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class DesugarIncrementalHelperTest {
-
-    public static final String PROJECT_VARIANT = "app:debug";
-    @Rule public TemporaryFolder tmpDir = new TemporaryFolder();
-
-    public DesugarIncrementalHelperTest() {}
-
-    @Before
-    public void setUp() {
-        // remove any previous state first
-        getDesugarIncrementalTransformHelper(false, Collections.emptySet(), Collections.emptySet())
-                .getAdditionalPaths();
-    }
-
-    @Test
-    public void testBasicFull() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-    }
-
-    @Test
-    public void testIncremental_baseInterfaceChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, CarbonForm.class);
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths)
-                .containsExactlyElementsIn(getPaths(input, Animal.class, Cat.class, Tiger.class));
-    }
-
-    @Test
-    public void testIncremental_intermediateInterfaceChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, Animal.class);
-
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths)
-                .containsExactlyElementsIn(getPaths(input, Cat.class, Tiger.class));
-    }
-
-    @Test
-    public void testIncremental_functionalInterfaceChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, Toy.class);
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths)
-                .containsExactlyElementsIn(getPaths(input, Cat.class, Tiger.class));
-    }
-
-    @Test
-    public void testIncremental_superClassChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, Cat.class);
-
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths).containsExactlyElementsIn(getPaths(input, Tiger.class));
-    }
-
-    @Test
-    public void testIncremental_classChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, Tiger.class);
-
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths).isEmpty();
-    }
-
-    @Test
-    public void testIncremental_multipleChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> changedPaths = getChangedPaths(input, CarbonForm.class, Toy.class);
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), changedPaths)
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths)
-                .containsExactlyElementsIn(getPaths(input, Cat.class, Animal.class, Tiger.class));
-    }
-
-    @Test
-    public void testIncremental_noneChange() throws IOException {
-        Path input = tmpDir.getRoot().toPath().resolve("input");
-        initializeGraph(input);
-
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), Collections.emptySet())
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths).isEmpty();
-    }
-
-    @Test
-    public void testDirAndJarInput_incremental() throws IOException {
-        Path inputDir = tmpDir.getRoot().toPath().resolve("input_dir");
-        Path inputJar = tmpDir.getRoot().toPath().resolve("input.jar");
-        ImmutableSet<File> allInputs = ImmutableSet.of(inputDir.toFile(), inputJar.toFile());
-
-        TestInputsGenerator.pathWithClasses(
-                inputDir, ImmutableList.of(Cat.class, Toy.class, Tiger.class));
-        TestInputsGenerator.pathWithClasses(
-                inputJar, ImmutableList.of(Animal.class, CarbonForm.class));
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.emptySet())
-                                .getAdditionalPaths())
-                .isEmpty();
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.singleton(inputJar))
-                                .getAdditionalPaths())
-                .containsExactlyElementsIn(getPaths(inputDir, Cat.class, Tiger.class));
-
-        Set<Path> changedPaths = getChangedPaths(inputDir, Toy.class);
-        assertThat(
-                        getDesugarIncrementalTransformHelper(true, allInputs, changedPaths)
-                                .getAdditionalPaths())
-                .containsExactlyElementsIn(getPaths(inputDir, Cat.class, Tiger.class));
-    }
-
-    @Test
-    public void testDirAndJarInput_incremental_jarDependsOnDir() throws IOException {
-        Path inputDir = tmpDir.getRoot().toPath().resolve("input_dir");
-        Path inputJar = tmpDir.getRoot().toPath().resolve("input.jar");
-        ImmutableSet<File> allInputs = ImmutableSet.of(inputDir.toFile(), inputJar.toFile());
-
-        TestInputsGenerator.pathWithClasses(
-                inputDir, ImmutableList.of(Animal.class, CarbonForm.class));
-        TestInputsGenerator.pathWithClasses(
-                inputJar, ImmutableList.of(Cat.class, Toy.class, Tiger.class));
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.emptySet())
-                                .getAdditionalPaths())
-                .isEmpty();
-
-        Set<Path> changedPaths = getChangedPaths(inputDir, Animal.class);
-        assertThat(
-                        getDesugarIncrementalTransformHelper(true, allInputs, changedPaths)
-                                .getAdditionalPaths())
-                .containsExactly(inputJar);
-    }
-
-    @Test
-    public void testTwoJars_incremental() throws IOException {
-        Path fstJar = tmpDir.getRoot().toPath().resolve("input1.jar");
-        Path sndJar = tmpDir.getRoot().toPath().resolve("input2.jar");
-        ImmutableSet<File> allInputs = ImmutableSet.of(fstJar.toFile(), sndJar.toFile());
-
-        TestInputsGenerator.pathWithClasses(
-                fstJar, ImmutableList.of(Cat.class, Toy.class, Tiger.class));
-        TestInputsGenerator.pathWithClasses(
-                sndJar, ImmutableList.of(Animal.class, CarbonForm.class));
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.emptySet())
-                                .getAdditionalPaths())
-                .isEmpty();
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.singleton(sndJar))
-                                .getAdditionalPaths())
-                .containsExactly(fstJar);
-    }
-
-    @Test
-    public void test_typeInMultiplePaths() throws IOException {
-        Path fstJar = tmpDir.getRoot().toPath().resolve("input1.jar");
-        Path sndJar = tmpDir.getRoot().toPath().resolve("input2.jar");
-        Path trdJar = tmpDir.getRoot().toPath().resolve("input3.jar");
-        ImmutableSet<File> allInputs =
-                ImmutableSet.of(fstJar.toFile(), sndJar.toFile(), trdJar.toFile());
-
-        TestInputsGenerator.pathWithClasses(fstJar, ImmutableList.of(Animal.class));
-        TestInputsGenerator.pathWithClasses(sndJar, ImmutableList.of(Cat.class));
-        TestInputsGenerator.pathWithClasses(trdJar, ImmutableList.of(Cat.class));
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.emptySet())
-                                .getAdditionalPaths())
-                .isEmpty();
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true, allInputs, Collections.singleton(fstJar))
-                                .getAdditionalPaths())
-                .containsExactly(sndJar, trdJar);
-    }
-
-    @Test
-    public void test_incrementalDeletedNonInitialized() {
-        Path fstJar = tmpDir.getRoot().toPath().resolve("input1.jar");
-
-        assertThat(
-                        getDesugarIncrementalTransformHelper(
-                                        true,
-                                        Collections.singleton(fstJar.toFile()),
-                                        Collections.singleton(fstJar))
-                                .getAdditionalPaths())
-                .isEmpty();
-    }
-
-    private static void initializeGraph(@NonNull Path input) throws IOException {
-        TestInputsGenerator.pathWithClasses(
-                input,
-                ImmutableList.of(
-                        Animal.class, CarbonForm.class, Cat.class, Toy.class, Tiger.class));
-
-        Set<Path> impactedPaths =
-                getDesugarIncrementalTransformHelper(
-                                true, Collections.singleton(input.toFile()), Collections.emptySet())
-                        .getAdditionalPaths();
-
-        assertThat(impactedPaths).isEmpty();
-    }
-
-    @NonNull
-    private static DesugarIncrementalHelper getDesugarIncrementalTransformHelper(
-            boolean isIncremental,
-            @NonNull Iterable<File> allInputs,
-            @NonNull Set<Path> changedPaths) {
-        return new DesugarIncrementalHelper(
-                PROJECT_VARIANT,
-                isIncremental,
-                allInputs,
-                () -> changedPaths,
-                WaitableExecutor.useDirectExecutor());
-    }
-
-    @NonNull
-    private static Set<Path> getChangedPaths(@NonNull Path root, @NonNull Class<?>... classes) {
-        return new HashSet<>(getPaths(root, classes));
-    }
-
-    @NonNull
-    private static Collection<Path> getPaths(@NonNull Path root, @NonNull Class<?>... classes) {
-        List<Path> path = new ArrayList<>(classes.length);
-        for (Class<?> klass : classes) {
-            path.add(root.resolve(TestInputsGenerator.getPath(klass)));
-        }
-        return path;
-    }
-}
diff --git a/build-system/integration-test/application/src/test/java/com/android/build/gradle/integration/sanity/JarContentsTest.java b/build-system/integration-test/application/src/test/java/com/android/build/gradle/integration/sanity/JarContentsTest.java
index 8f5a640..4c0c0df 100644
--- a/build-system/integration-test/application/src/test/java/com/android/build/gradle/integration/sanity/JarContentsTest.java
+++ b/build-system/integration-test/application/src/test/java/com/android/build/gradle/integration/sanity/JarContentsTest.java
@@ -220,7 +220,6 @@
                 "com/android/builder/core/",
                 "com/android/builder/dependency/",
                 "com/android/builder/dependency/level2/",
-                "com/android/builder/desugaring/",
                 "com/android/builder/dexing/",
                 "com/android/builder/dexing/r8/",
                 "com/android/builder/errors/",