public static ServerId of(@Nullable String databaseId, String datasetId) {
    if (databaseId != null) {
      int databaseIdLength = databaseId.length();
      checkArgument(databaseIdLength == DATABASE_ID_LENGTH, "Illegal databaseId length (%s)", databaseIdLength);
    }
    int datasetIdLength = datasetId.length();
    checkArgument(datasetIdLength == DEPRECATED_SERVER_ID_LENGTH
      || datasetIdLength == NOT_UUID_DATASET_ID_LENGTH
      || datasetIdLength == UUID_DATASET_ID_LENGTH, "Illegal datasetId length (%s)", datasetIdLength);
    return new ServerId(databaseId, datasetId);
  }
@Test
  @UseDataProvider("illegalDatasetIdLengths")
  public void of_throws_IAE_if_datasetId_length_is_not_8(int illegalDatasetIdLengths) {
    String datasetId = randomAlphabetic(illegalDatasetIdLengths);
    String databaseId = randomAlphabetic(DATABASE_ID_LENGTH);

    assertThatThrownBy(() -> ServerId.of(databaseId, datasetId))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Illegal datasetId length (" + illegalDatasetIdLengths + ")");
  }