private void closeSegmentAndDeleteFile(LogSegment segment) throws IOException {
    segment.close(false);
    assertFalse("File channel is not closed", segment.getView().getSecond().isOpen());
    File segmentFile = segment.getView().getFirst();
    assertTrue("The segment file [" + segmentFile.getAbsolutePath() + "] could not be deleted", segmentFile.delete());
  }
Closes the {@code segment} and deletes the backing file.
@param segment the {@link LogSegment} that needs to be closed and whose backing file needs to be deleted.
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/LogSegmentTest.java