AsyncDevicesGetter { @VisibleForTesting final void initChecker(@Nullable RunnerAndConfigurationSettings configurationAndSettings, @NotNull Function<Module, AndroidFacet> facetGetter) { if (configurationAndSettings == null) { myChecker = null; return; } Object configuration = configurationAndSettings.getConfiguration(); if (!(configuration instanceof ModuleBasedConfiguration)) { myChecker = null; return; } Module module = ((ModuleBasedConfiguration)configuration).getConfigurationModule().getModule(); if (module == null) { myChecker = null; return; } AndroidFacet facet = facetGetter.apply(module); if (facet == null || Disposer.isDisposed(facet)) { myChecker = null; return; } Object platform = AndroidPlatform.getInstance(facet.getModule()); if (platform == null) { myChecker = null; return; } myChecker = LaunchCompatibilityCheckerImpl.create(facet, null, null); } @SuppressWarnings("unused") private  AsyncDevicesGetter(@NotNull Project project); @NonInjectable @VisibleForTesting  AsyncDevicesGetter(@NotNull Project project,
                     @NotNull BooleanSupplier selectDeviceSnapshotComboBoxSnapshotsEnabled,
                     @NotNull KeyToConnectionTimeMap map,
                     @NotNull Function<ConnectedDevice, String> getName);   }
@Test public void initChecker() { RunConfigurationModule configurationModule = Mockito.mock(RunConfigurationModule.class); Mockito.when(configurationModule.getModule()).thenReturn(myRule.getModule()); ModuleBasedConfiguration configuration = Mockito.mock(ModuleBasedConfiguration.class); Mockito.when(configuration.getConfigurationModule()).thenReturn(configurationModule); RunnerAndConfigurationSettings configurationAndSettings = Mockito.mock(RunnerAndConfigurationSettings.class); Mockito.when(configurationAndSettings.getConfiguration()).thenReturn(configuration); myGetter.initChecker(configurationAndSettings, AsyncDevicesGetterTest::newAndroidFacet); assertNull(myGetter.getChecker()); }