static void sanityCheckExcludedRackIds(Builder builder) {
    if (builder._excludedRackIds != null && builder._numBrokers == DEFAULT_OPTIONAL_INT) {
      throw new IllegalArgumentException("Excluded rack ids can be specified only with the number of brokers.");
    }
  }
@Test
  public void testSanityCheckExcludedRackIds() {
    // Set excluded rack ids without numBrokers
    assertThrows(IllegalArgumentException.class, () -> ProvisionRecommendation.sanityCheckExcludedRackIds(
        new ProvisionRecommendation.Builder(ProvisionStatus.UNDER_PROVISIONED).numRacks(1).excludedRackIds(Collections.singleton("1"))));
  }