code: private FileStatus findStatusForSegment(String segmentName, boolean enforceExistence) throws IOException {
          FileStatus[] rawFiles = findAllRaw(segmentName);
          if (rawFiles == null || rawFiles.length == 0) {
              if (enforceExistence) {
                  throw HDFSExceptionHelpers.segmentNotExistsException(segmentName);
              }
  
              return null;
          }
  
          val result = Arrays.stream(rawFiles)
                             .sorted(this::compareFileStatus)
                             .collect(Collectors.toList());
          return result.get(result.size() -1);
      }
docs: Gets the filestatus representing the segment.
  
  @param segmentName      The name of the Segment to retrieve for.
  @param enforceExistence If true, it will throw a FileNotFoundException if no files are found, otherwise null is returned.
  @return FileStatus of the HDFS file.
  @throws IOException If an exception occurred.