@Functional
  public boolean asBoolean() {
    switch (this) {
      case YES:
        return true;
      case NO:
        return false;
      case UNSET:
        throw new IllegalStateException("No boolean equivalent for UNSET");
      default:
        throw new IllegalStateException("Unrecognized TriState value: " + this);
    }
  }
Returns the {@code boolean} value that corresponds to this {@link TriState}, if appropriate.

@return {@code true} if {@code this} is {@link TriState#YES} or {@code false} if {@code this}
    is {@link TriState#NO}
@throws IllegalStateException if {@code this} is {@link TriState#UNSET}.
fbcore/src/main/java/com/facebook/common/util/TriState.java