code: public static String extractPrimaryStreamSegmentName(String streamSegmentName) {
          if (isTransactionSegment(streamSegmentName)) {
              return extractPrimaryStreamSegmentName(getParentStreamSegmentName(streamSegmentName));
          }
          int endOfStreamNamePos = streamSegmentName.lastIndexOf(EPOCH_DELIMITER);
          if (endOfStreamNamePos < 0) {
              // epoch delimiter not present in the name, return the full name
              return streamSegmentName;
          }
          return streamSegmentName.substring(0, endOfStreamNamePos);
      }
docs: Attempts to extract the primary part of stream segment name before the epoch delimiter. This method returns a
  valid value only if the StreamSegmentName was generated using the getQualifiedStreamSegmentName method.
  
  @param streamSegmentName The name of the StreamSegment to extract the name of the Primary StreamSegment name.
  @return The primary part of StreamSegment.