public static Collection<MultipartFile> getUploadFiles(final HttpServletRequest request) {
        MultiValueMap<String, MultipartFile> fileMap = null;
        //Check whether there is：enctype="multipart/form-data" in the form.
        String contentType = request.getContentType();
        if (Objects.nonNull(contentType) && contentType.toLowerCase().contains("multipart")) {
            //Change the request into a multipart request.
            MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
            fileMap = multiRequest.getMultiFileMap();
        }
        return Optional.ofNullable(fileMap)
            .map(Map::entrySet)
            .map(entry -> entry.stream()
                .flatMap(e -> e.getValue().stream())
                .collect(Collectors.toList()))
            .orElse(Collections.emptyList());
    }
@Test
    public void testListUtil() {
        final MultipartHttpServletRequest httpServletRequest = mock(MultipartHttpServletRequest.class);
        Assertions.assertNotNull(UploadUtils.getUploadFiles(httpServletRequest));
        when(httpServletRequest.getContentType()).thenReturn("multipart");
        final MultiValueMap<String, MultipartFile> fileMultiValueMap = new LinkedMultiValueMap<>();
        fileMultiValueMap.add("file", mock(MultipartFile.class));
        when(httpServletRequest.getMultiFileMap()).thenReturn(fileMultiValueMap);
        final Collection<MultipartFile> uploadFiles = UploadUtils.getUploadFiles(httpServletRequest);
        Assertions.assertTrue(CollectionUtils.isNotEmpty(uploadFiles));
    }