TypedefRemover { public void remove(@NonNull File classDir, @NonNull List<String> owners) { if (!mQuiet) { info("Deleting @IntDef and @StringDef annotation class files"); } for (String owner : owners) { addTypeDef(owner); } rewriteOuterClasses(classDir); deleteAnnotationClasses(classDir); } TypedefRemover(
            @Nullable Extractor extractor,
            boolean quiet,
            boolean verbose,
            boolean dryRun);  TypedefRemover(); @NonNull TypedefRemover setTypedefFile(@NonNull File file); @Nullable InputStream filter(@NonNull String path, @NonNull InputStream input); boolean isRemoved(@NonNull String path); void removeFromTypedefFile(@NonNull File classDir, @NonNull File file); void remove(@NonNull File classDir, @NonNull List<String> owners);  }
@Test public void testRemoveFiles() throws IOException { TypedefRemover remover = new TypedefRemover(); testFolder.newFolder("test", "pkg"); File innerClass = testFolder.newFile("test/pkg/OuterClass$InnerClass.class"); File outerClass = testFolder.newFile("test/pkg/OuterClass.class"); File unrelated = testFolder.newFile("test/pkg/Unrelated.class"); innerClass.getParentFile().mkdirs(); Files.write(INNER_CLASS, innerClass); Files.write(OUTER_CLASS, outerClass); Files.write(new byte[0], unrelated); remover.remove(testFolder.getRoot(), Collections.singletonList("test/pkg/OuterClass$InnerClass")); assertThat(unrelated.isFile()).isTrue(); assertThat(innerClass.exists()).isFalse(); assertThat(Files.toByteArray(outerClass)).isEqualTo(REWRITTEN_OUTER_CLASS); }