@Override
  public String generateSegmentName(int sequenceId, @Nullable Object minTimeValue, @Nullable Object maxTimeValue) {
    if (_excludeTimeInSegmentName) {
      return JOINER.join(_segmentNamePrefix, _segmentNamePostfix, sequenceId >= 0 ? sequenceId : null,
          _appendUUIDToSegmentName ? UUID.randomUUID().toString() : null);
    } else {
      if (minTimeValue != null) {
        SegmentNameUtils.validatePartialOrFullSegmentName(minTimeValue.toString());
      }
      if (maxTimeValue != null) {
        SegmentNameUtils.validatePartialOrFullSegmentName(maxTimeValue.toString());
      }

      return JOINER.join(_segmentNamePrefix, minTimeValue, maxTimeValue, _segmentNamePostfix,
          sequenceId >= 0 ? sequenceId : null, _appendUUIDToSegmentName ? UUID.randomUUID().toString() : null);
    }
  }
@Test
  public void testWithMalFormedTableNameSegmentNamePostfixTimeValue() {
    try {
      new SimpleSegmentNameGenerator(MALFORMED_TABLE_NAME, SEGMENT_NAME_POSTFIX);
      Assert.fail();
    } catch (IllegalArgumentException e) {
      // Expected
    }
    try {
      new SimpleSegmentNameGenerator(TABLE_NAME, MALFORMED_SEGMENT_NAME_POSTFIX);
      Assert.fail();
    } catch (IllegalArgumentException e) {
      // Expected
    }
    try {
      SegmentNameGenerator segmentNameGenerator = new SimpleSegmentNameGenerator(TABLE_NAME, SEGMENT_NAME_POSTFIX);
      segmentNameGenerator.generateSegmentName(VALID_SEQUENCE_ID, MIN_TIME_VALUE, MALFORMED_TIME_VALUE);
      Assert.fail();
    } catch (IllegalArgumentException e) {
      // Expected
      assertEquals(e.getMessage(), "Invalid partial or full segment name: 12|34");
    }
  }