### Question:
AbstractCompilesUtil { @NonNull @VisibleForTesting public static JavaVersion getDefaultJavaVersion(@NonNull String compileSdkVersion) { String currentJdkVersion = System.getProperty("java.specification.version"); final AndroidVersion hash = AndroidTargetHash.getVersionFromHash(compileSdkVersion); Integer compileSdkLevel = (hash == null ? null : hash.getFeatureLevel()); JavaVersion javaVersionToUse; if (compileSdkLevel == null) { javaVersionToUse = JavaVersion.VERSION_1_6; } else { if (0 < compileSdkLevel && compileSdkLevel <= 20) { javaVersionToUse = JavaVersion.VERSION_1_6; } else if (21 <= compileSdkLevel && compileSdkLevel < 24) { javaVersionToUse = JavaVersion.VERSION_1_7; } else { javaVersionToUse = JavaVersion.VERSION_1_7; } } JavaVersion jdkVersion = JavaVersion.toVersion(currentJdkVersion); if (jdkVersion.compareTo(javaVersionToUse) < 0) { Logging.getLogger(AbstractCompilesUtil.class).warn( "Default language level for compileSdkVersion '{}' is " + "{}, but the JDK used is {}, so the JDK language level will be used.", compileSdkVersion, javaVersionToUse, jdkVersion); javaVersionToUse = jdkVersion; } return javaVersionToUse; }  @NonNull @VisibleForTesting static JavaVersion getDefaultJavaVersion(@NonNull String compileSdkVersion); static final String ANDROID_APT_PLUGIN_NAME; }### Answer:
@Test public void testChooseDefaultJavaVersion_jdk8() throws Exception { Assert.assertEquals(JavaVersion.VERSION_1_6, getDefaultJavaVersion("android-15")); Assert.assertEquals(JavaVersion.VERSION_1_7, getDefaultJavaVersion("android-21")); Assert.assertEquals( JavaVersion.VERSION_1_7, getDefaultJavaVersion("Google Inc.:Google APIs:22")); Assert.assertEquals(JavaVersion.VERSION_1_7, getDefaultJavaVersion("android-24")); Assert.assertEquals(JavaVersion.VERSION_1_7, getDefaultJavaVersion("android-24")); Assert.assertEquals(JavaVersion.VERSION_1_7, getDefaultJavaVersion("android-24")); }