@Functional
  public static TriState valueOf(boolean bool) {
    return bool ? YES : NO;
  }
Returns the value of the {@link TriState} enum that corresponds to the specified {@code
boolean}.

<p>This method deliberately declares {@code boolean} as its param type rather than {@link
Boolean} because:

<ol>
  <li>Declaring {@link Boolean} would likely result in a bunch of unnecessary autoboxing.
  <li>Anyone who finds himself using a {@link Boolean} instead of a {@code boolean} for its
      nullability should replace the {@link Boolean} with a {@link TriState}, anyway.
</ol>
fbcore/src/main/java/com/facebook/common/util/TriState.java