code: public static KinesisInitialPosition fromKinesisInitialPosition(
              InitialPositionInStream initialPositionInStream) throws UnsupportedOperationException {
          if (initialPositionInStream == InitialPositionInStream.LATEST) {
              return new Latest();
          } else if (initialPositionInStream == InitialPositionInStream.TRIM_HORIZON) {
              return new TrimHorizon();
          } else {
              // InitialPositionInStream.AT_TIMESTAMP is not supported.
              // Use InitialPosition.atTimestamp(timestamp) instead.
              throw new UnsupportedOperationException(
                      "Only InitialPositionInStream.LATEST and InitialPositionInStream." +
                              "TRIM_HORIZON supported in initialPositionInStream(). Please use " +
                              "the initialPosition() from builder API in KinesisInputDStream for " +
                              "using InitialPositionInStream.AT_TIMESTAMP");
          }
      }
docs: Returns instance of [[KinesisInitialPosition]] based on the passed
  [[InitialPositionInStream]]. This method is used in KinesisUtils for translating the
  InitialPositionInStream to InitialPosition. This function would be removed when we deprecate
  the KinesisUtils.
  
  @return [[InitialPosition]]