### Question:
DockerRegistryCleanTask { @Scheduled(cron = "0 0 3 * * ? ") public void cleanDockerImageTag() { log.info("DockerRegistry执行清洗计划..."); try { List<DockerImage> cleanList = this.getCleanTags(reserveSize); log.info("需要清理的镜像[{}]个.", cleanList.size()); cleanList.forEach(dockerImage -> { log.info("清理镜像：[{}/{}:{}]", dockerImage.getRegistry(), dockerImage.imageName, dockerImage.imageTag); dockerRegistryService.deleteTag(dockerImage.getRegistry(), dockerImage.imageName, dockerImage.imageTag); List<RmsDockerImageEntity> rmsDockerImageEntityList = this.dockerImageService.selectEntity(new RmsDockerImageEntity(dockerImage.getRegistry(), dockerImage.imageName, dockerImage.imageTag, IsDeleted.NOT_DELETED)); if (!ObjectUtils.isEmpty(rmsDockerImageEntityList)) { rmsDockerImageEntityList.forEach(rmsDockerImageEntity -> this.dockerImageService.updateByPrimaryKeySelective(new RmsDockerImageEntity(rmsDockerImageEntity.getId(), IsDeleted.DELETED))); } }); } catch (Exception e) { log.warn("DockerRegistry清洗计划执行失败", e); } }  @Scheduled(cron = "0 0 3 * * ? ") void cleanDockerImageTag();  }### Answer:
@Test public void cleanDockerImageTag() { List<String> imageTags = this.imageTag(); log.info("tags:{}", imageTags); Map<String, List<String>> listMap = imageTags.stream() .sorted(Comparator.reverseOrder()) .collect(Collectors.groupingBy(tag -> { String t = tag.substring(0, tag.indexOf("_")); log.info(t); return t; })); log.info("listMap:{}", listMap); }