Program: 20268
Project: 20268
Buggy source:
@Test public void startingAndroidAppWithCapabilitiesAndFlagsOnServerSideTest(){
  File appDir=new File("String_Node_Str");
  File app=new File(appDir,"String_Node_Str");
  WebDriverManager chromeManager=chromedriver();
  chromeManager.setup();
  DesiredCapabilities serverCapabilities=new DesiredCapabilities();
  serverCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"String_Node_Str");
  serverCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"String_Node_Str");
  serverCapabilities.setCapability(MobileCapabilityType.FULL_RESET,true);
  serverCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,60);
  serverCapabilities.setCapability(MobileCapabilityType.APP,app.getAbsolutePath());
  serverCapabilities.setCapability(AndroidMobileCapabilityType.CHROMEDRIVER_EXECUTABLE,chromeManager.getBinaryPath());
  AppiumServiceBuilder builder=new AppiumServiceBuilder().withArgument(GeneralServerFlag.SESSION_OVERRIDE).withArgument(GeneralServerFlag.STRICT_CAPS).withCapabilities(serverCapabilities);
  DesiredCapabilities clientCapabilities=new DesiredCapabilities();
  clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE,"String_Node_Str");
  clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY,"String_Node_Str");
  AndroidDriver<?> driver=new AndroidDriver<>(builder,clientCapabilities);
  try {
    Capabilities caps=driver.getCapabilities();
    assertEquals(true,caps.getCapability(MobileCapabilityType.PLATFORM_NAME).equals(MobilePlatform.ANDROID));
    assertNotEquals(null,caps.getCapability(MobileCapabilityType.DEVICE_NAME));
  }
  finally {
    driver.quit();
  }
}

Fixed version (ground truth):
@Test public void startingAndroidAppWithCapabilitiesAndFlagsOnServerSideTest(){
  File appDir=new File("String_Node_Str");
  File app=new File(appDir,"String_Node_Str");
  DesiredCapabilities serverCapabilities=new DesiredCapabilities();
  serverCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"String_Node_Str");
  serverCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"String_Node_Str");
  serverCapabilities.setCapability(MobileCapabilityType.FULL_RESET,true);
  serverCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,60);
  serverCapabilities.setCapability(MobileCapabilityType.APP,app.getAbsolutePath());
  WebDriverManager chromeManager=chromedriver();
  chromeManager.setup();
  serverCapabilities.setCapability(AndroidMobileCapabilityType.CHROMEDRIVER_EXECUTABLE,chromeManager.getBinaryPath());
  AppiumServiceBuilder builder=new AppiumServiceBuilder().withArgument(GeneralServerFlag.SESSION_OVERRIDE).withArgument(GeneralServerFlag.STRICT_CAPS).withCapabilities(serverCapabilities);
  DesiredCapabilities clientCapabilities=new DesiredCapabilities();
  clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE,"String_Node_Str");
  clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY,"String_Node_Str");
  AndroidDriver<?> driver=new AndroidDriver<>(builder,clientCapabilities);
  try {
    Capabilities caps=driver.getCapabilities();
    assertEquals(true,caps.getCapability(MobileCapabilityType.PLATFORM_NAME).equals(MobilePlatform.ANDROID));
    assertNotEquals(null,caps.getCapability(MobileCapabilityType.DEVICE_NAME));
  }
  finally {
    driver.quit();
  }
}