### Question:
CmakeServerExternalNativeJsonGenerator extends CmakeExternalNativeJsonGenerator { @NonNull @Override List<String> getCacheArguments(@NonNull JsonGenerationAbiConfiguration abiConfig) { List<String> cacheArguments = getCommonCacheArguments(abiConfig); cacheArguments.add("-DCMAKE_SYSTEM_NAME=Android"); cacheArguments.add(String.format("-DCMAKE_ANDROID_ARCH_ABI=%s", abiConfig.getAbiName())); cacheArguments.add( String.format("-DCMAKE_SYSTEM_VERSION=%s", abiConfig.getAbiPlatformVersion())); cacheArguments.add("-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"); cacheArguments.add(String.format("-DCMAKE_ANDROID_NDK=%s", getNdkFolder())); cacheArguments.add( String.format( "-DCMAKE_TOOLCHAIN_FILE=%s", getToolchainFile(abiConfig.getAbiName()).getAbsolutePath())); cacheArguments.add("-G Ninja"); File possibleNinja = isWindows() ? new File(getCmakeBinFolder(), "ninja.exe") : new File(getCmakeBinFolder(), "ninja"); if (possibleNinja.isFile()) { cacheArguments.add(String.format("-DCMAKE_MAKE_PROGRAM=%s", possibleNinja)); } return cacheArguments; } CmakeServerExternalNativeJsonGenerator(
            @NonNull JsonGenerationVariantConfiguration config,
            @NonNull Set<String> configurationFailures,
            @NonNull AndroidBuilder androidBuilder,
            @NonNull File cmakeFolder,
            @NonNull GradleBuildVariant.Builder stats); @NonNull @Override String executeProcessAndGetOutput(@NonNull JsonGenerationAbiConfiguration abiConfig);  }### Answer:
@Test public void testGetCacheArguments() throws IOException { CmakeServerExternalNativeJsonGenerator cmakeServerStrategy = getCMakeServerGenerator(); JsonGenerationAbiConfiguration abiConfig = createJsonGenerationAbiConfiguration( Abi.X86, "debug", tmpFolder.newFolder("my-json"), tmpFolder.newFolder("my-obj"), NativeBuildSystem.CMAKE, 12); List<String> cacheArguments = cmakeServerStrategy.getProcessBuilderArgs(abiConfig); assertThat(cacheArguments).isNotEmpty(); assertThat(cacheArguments).contains("-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"); assertThat(cacheArguments) .contains( String.format( "-DCMAKE_ANDROID_NDK=%s", cmakeServerStrategy.getNdkFolder())); assertThat(cacheArguments).contains("-DCMAKE_SYSTEM_NAME=Android"); assertThat(cacheArguments).contains("-DCMAKE_BUILD_TYPE=Debug"); assertThat(cacheArguments).contains("-DCMAKE_C_FLAGS=c-flags1 c-flag2"); assertThat(cacheArguments).contains("-DCMAKE_CXX_FLAGS=cpp-flags1 cpp-flag2"); assertThat(cacheArguments).contains("build-argument-foo"); assertThat(cacheArguments).contains("build-argument-bar"); assertThat(cacheArguments).contains("build-argument-baz"); assertThat(cacheArguments).contains("-G Ninja"); int indexOfSubset = Collections.indexOfSubList(cacheArguments, buildArguments); assertThat(cacheArguments.size() - indexOfSubset).isEqualTo(buildArguments.size()); }