### Question:
DicomUidValidator { public static boolean isLengthValid(String uid) { if (StringUtils.isBlank(uid)) { return false; } return uid.length() <= MAX_LENGTH; }  static boolean isValid(String uid); static boolean isLengthValid(String uid); static boolean isPatternValid(String uid);  }### Answer:
@Test public void isLengthValid_shouldReturnFalseGivenNull() throws Exception { assertFalse(DicomUidValidator.isLengthValid(null)); }
@Test public void isLengthValid_shouldReturnFalseGivenEmptyString() throws Exception { assertFalse(DicomUidValidator.isLengthValid(" ")); }
@Test public void isLengthValid_shouldReturnFalseForUidLengthBiggerThan64() throws Exception { String uid = StringUtils.repeat("1.2", 22); assertThat(uid.length(), is(greaterThan(64))); assertFalse(DicomUidValidator.isLengthValid(uid)); }
@Test public void isLengthValid_shouldReturnTrueForUidLengthSmallerOrEqualTo64() throws Exception { String uid = StringUtils.repeat("1.2", 20); assertThat(uid.length(), is(not(greaterThan(64)))); assertTrue(DicomUidValidator.isLengthValid(uid)); uid = StringUtils.repeat("1.2", 20) + "8317"; assertThat(uid.length(), is(64)); assertTrue(DicomUidValidator.isLengthValid(uid)); }