code: public byte[] findScreenshot(Throwable t) {
          byte[] result = null;
          if (t != null) {
              if (t instanceof ScreenshotException) {
                  String encodedScreenshot = ((ScreenshotException)t).getBase64EncodedScreenshot();
                  result = Base64.getDecoder().decode(encodedScreenshot);
              } else {
                  result = findScreenshot(t.getCause());
              }
          }
          return result;
      }
docs: Finds screenshot embedded in throwable, if any.
  @param t exception to search in.
  @return content of screenshot (if any is present), null otherwise.