GeneratedSourceFolders { public boolean isFolderGeneratedInCorrectLocation(@NotNull File folderPath, @NotNull IdeAndroidProject androidProject) { File generatedFolderPath = new File(androidProject.getBuildFolder(), FD_GENERATED); return isAncestor(generatedFolderPath, folderPath, false); }  boolean isFolderGeneratedInCorrectLocation(@NotNull File folderPath, @NotNull IdeAndroidProject androidProject);  }
@Test public void testIsFolderGeneratedInCorrectLocation() { File buildFolderPath = new File("build"); Mockito.when(myAndroidProject.getBuildFolder()).thenReturn(buildFolderPath); File aFolderPath = new File(buildFolderPath, join("generated", "a")); File bFolderPath = new File("b"); assertTrue(myGeneratedSourceFolders.isFolderGeneratedInCorrectLocation(aFolderPath, myAndroidProject)); assertFalse(myGeneratedSourceFolders.isFolderGeneratedInCorrectLocation(bFolderPath, myAndroidProject)); }