public boolean deleteIfExists() throws IOException {
        close();
        return Files.deleteIfExists(file.toPath());
    }
@Test
    public void testDeleteIfExists() throws IOException {
        assertTrue(file.exists());
        index.deleteIfExists();
        assertFalse(file.exists());
    }