### Question:
ApiRepoPathReader { public List<String> validate(String name) { this.name = name; List<String> errors = new ArrayList<String>(); String stripedName = org.springframework.util.StringUtils.stripFilenameExtension(name); String[] array = stripedName.split(SEPARATOR); if(array.length == 1) { String order = array[0]; try { LocalDateTime.parse(order, DateTimeFormatter.ofPattern("yyyyMMddHHmm")); pathInfo = new ApiRepoPathInfo(array[0], null); }catch(DateTimeParseException e) { errors.add(order + "应该是格式为 yyyyMMddHHmm 的时间"); } }else if(array.length >=2 ) { String order = array[0]; try { LocalDateTime.parse(order, DateTimeFormatter.ofPattern("yyyyMMddHHmm")); String[] left = Arrays.copyOfRange(array, 1, array.length); pathInfo = new ApiRepoPathInfo(array[0], String.join(SEPARATOR, left)); }catch(DateTimeParseException e) { errors.add(order + "应该是格式为 yyyyMMddHHmm 的时间"); } } return errors; }  ApiRepoPathInfo read(String name); List<String> validate(String name);  }### Answer:
@Test public void validate() { ApiRepoPathReader reader = new ApiRepoPathReader(); assertThat(reader.validate("1")).hasSize(1); assertThat(reader.validate("202005200808__description1")).isEmpty(); assertThat(reader.validate("202005200808")).isEmpty(); assertThat(reader.validate("202005200808__")).isEmpty(); assertThat(reader.validate("202005200808__a__b_c")).isEmpty(); assertThat(reader.validate("202005200808.json")).isEmpty(); }