@Nullable
  private BoringLayout.Metrics isBoringLayout() {
    try {
      return BoringLayout.isBoring(mParams.text, mParams.paint);
    } catch (NullPointerException e) {
      // On older Samsung devices (< M), we sometimes run into a NPE here where a FontMetricsInt
      // object created within BoringLayout is not properly null-checked within TextLine.
      // Its ok to ignore this exception since we'll create a regular StaticLayout later.
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        // If we see this on M or above, then its something else.
        throw e;
      }
      return null;
    }
  }
Builds and returns a {@link Layout}.

@return A {@link Layout} based on the parameters set. Returns null if no text was specified and
    empty text is not explicitly allowed (see {@link #setShouldLayoutZeroLengthText(boolean)}).
library/src/main/java/com/facebook/fbui/textlayoutbuilder/TextLayoutBuilder.java