public static IndexMainType main(Index index, String type) {
    return new IndexMainType(index, type);
  }
@Test
  @UseDataProvider("nullOrEmpty")
  public void main_fails_with_IAE_if_index_name_is_null_or_empty(String nullOrEmpty) {
    Index index = Index.simple("foo");

    assertThatThrownBy(() -> IndexType.main(index, nullOrEmpty))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("type name can't be null nor empty");
  }