public DropTypeCommand create(final DropType statement) {
    final String typeName = statement.getTypeName();
    final boolean ifExists = statement.getIfExists();

    if (!ifExists && !metaStore.resolveType(typeName).isPresent()) {
      throw new KsqlException("Type " + typeName + " does not exist.");
    }

    return new DropTypeCommand(typeName);
  }
@Test
  public void shouldCreateDropTypeForExistingTypeAndIfExistsSet() {
    // Given:
    final DropType dropType = new DropType(Optional.empty(), EXISTING_TYPE, true);

    // When:
    final DropTypeCommand cmd = factory.create(dropType);

    // Then:
    assertThat(cmd.getTypeName(), equalTo(EXISTING_TYPE));
  }