@Override
  @Nonnull
  public List<Sdk> selectSdks(Configuration configuration, UsesSdk usesSdk) {
    Config config = configuration.get(Config.class);
    Set<Sdk> sdks = new TreeSet<>(configuredSdks(config, usesSdk));
    if (enabledSdks != null) {
      sdks = Sets.intersection(sdks, enabledSdks);
    }
    return Lists.newArrayList(sdks);
  }
@Test
  public void withExplicitSdk_selectSdks() throws Exception {
    when(usesSdk.getTargetSdkVersion()).thenReturn(21);
    when(usesSdk.getMinSdkVersion()).thenReturn(19);
    when(usesSdk.getMaxSdkVersion()).thenReturn(22);

    assertThat(sdkPicker.selectSdks(buildConfig(new Config.Builder().setSdk(21)), usesSdk))
        .containsExactly(sdkCollection.getSdk(21));
    assertThat(
            sdkPicker.selectSdks(
                buildConfig(new Config.Builder().setSdk(Config.OLDEST_SDK)), usesSdk))
        .containsExactly(sdkCollection.getSdk(19));
    assertThat(
            sdkPicker.selectSdks(
                buildConfig(new Config.Builder().setSdk(Config.TARGET_SDK)), usesSdk))
        .containsExactly(sdkCollection.getSdk(21));
    assertThat(
            sdkPicker.selectSdks(
                buildConfig(new Config.Builder().setSdk(Config.NEWEST_SDK)), usesSdk))
        .containsExactly(sdkCollection.getSdk(22));

    assertThat(sdkPicker.selectSdks(buildConfig(new Config.Builder().setSdk(16)), usesSdk))
        .containsExactly(sdkCollection.getSdk(16));
    assertThat(sdkPicker.selectSdks(buildConfig(new Config.Builder().setSdk(23)), usesSdk))
        .containsExactly(sdkCollection.getSdk(23));
  }