Project { public static Project create(File directory, @Nullable Project parent) { GradleContext context = createContext(directory, parent); return new AutoValue_Project.Builder() .setProjectDirectory(directory) .setContext(context) .build(); }  static Project create(File directory, @Nullable Project parent); abstract GradleContext getContext(); abstract File getProjectDirectory(); static final String BUILD_GRADLE; }
@Test public void create_badProjectDirFails() throws Exception { File badProjectDir = TestUtils.getTestDataFile(BAD_PROJECT_DIR); assertThrows(RuntimeException.class, () -> Project.create(badProjectDir, null)); }