### Question:
DLUtils { public static String validateAndNormalizeName(String logName) throws InvalidStreamNameException { if (isReservedStreamName(logName)) { throw new InvalidStreamNameException(logName, "Log Name is reserved"); } if (logName.charAt(0) == '/') { validatePathName(logName); return logName.substring(1); } else { validatePathName("/" + logName); return logName; } }  static int findLogSegmentNotLessThanTxnId(List<LogSegmentMetadata> segments,
                                                     long transactionId); static Long nextLogSegmentSequenceNumber(List<LogSegmentMetadata> segmentListDesc); static long computeStartSequenceId(List<LogSegmentMetadata> logSegmentDescList,
                                              LogSegmentMetadata segment); static long deserializeLogSegmentSequenceNumber(byte[] data); static byte[] serializeLogSegmentSequenceNumber(long logSegmentSeqNo); static long deserializeTransactionId(byte[] data); static byte[] serializeTransactionId(long transactionId); static byte[] logSegmentId2Bytes(long logSegmentId); static long bytes2LogSegmentId(byte[] data); static URI normalizeURI(URI uri); static String normalizeClientId(String clientId); static boolean isReservedStreamName(String name); static String validateAndNormalizeName(String logName);  }### Answer:
@Test(timeout = 10000) public void testValidateLogName() throws Exception { String logName = "test-validate-log-name"; validateAndNormalizeName(logName); }
@Test(timeout = 10000, expected = InvalidStreamNameException.class) public void testValidateBadLogName0() throws Exception { String logName = " test-bad-log-name"; validateAndNormalizeName(logName); }
@Test(timeout = 10000, expected = InvalidStreamNameException.class) public void testValidateBadLogName1() throws Exception { String logName = "test-bad-log-name/"; validateAndNormalizeName(logName); }
@Test(timeout = 10000, expected = InvalidStreamNameException.class) public void testValidateBadLogName2() throws Exception { String logName = "../test-bad-log-name/"; validateAndNormalizeName(logName); }
@Test(timeout = 10000) public void testValidateSameStreamPath() throws Exception { String logName1 = "/test-resolve-log"; String logName2 = "test-resolve-log"; validateAndNormalizeName(logName1); validateAndNormalizeName(logName2); }