@Test
public void testSdkPatchesDisablementAndCorrectInstallerFactory() {

  FakeSettingsController settingsController = new FakeSettingsController(true);
  settingsController.setDisableSdkPatches(false);
  StudioSdkInstallerUtil sdkInstallerUtil = new StudioSdkInstallerUtil(settingsController);
  MockFileOp fop = new MockFileOp();
  final AndroidSdkHandler sdkHandler = new AndroidSdkHandler(null, new File("/sdk"), fop);
  InstallerFactory factory = sdkInstallerUtil.doCreateInstallerFactory(sdkHandler);
  assertThat(factory).isInstanceOf(PatchInstallerFactory.class);
  settingsController.setDisableSdkPatches(true);
  factory = sdkInstallerUtil.doCreateInstallerFactory(sdkHandler);
  assertThat(factory).isInstanceOf(BasicInstallerFactory.class);
}