ValidationRequestUtils { static FileType parseFileExtension(String fileExtension) { return Arrays.stream(FileType.values()) .filter(fileType -> fileType.name().equalsIgnoreCase(fileExtension)) .findFirst() .orElse(null); } private  ValidationRequestUtils();   }
@Test public void givenInvalidFileExtensionWillReturnNull() throws Exception { assertThat(ValidationRequestUtils.parseFileExtension("random")).isNull(); }
@Test public void givenBdocFileExtensionWillReturnFileTypeBDOC() throws Exception { assertThat(ValidationRequestUtils.parseFileExtension("bdoc")).isEqualTo(FileType.BDOC); }