FileUtils { public static int getPercentOfDeleted( @NotNull FileConfiguration configuration, @NotNull IndexService indexService, @NotNull Partition partition ) { long deleted = min(indexService.getSizeOfDeleted(partition), configuration.getMaxFileSize()); return (int) round((double) deleted / configuration.getMaxFileSize() * 100); } private  FileUtils(); static boolean isFileEmpty(@NotNull File file, @NotNull IndexElt elt); static long getCrc(byte[] data); static long getCrc(@NotNull File file); static java.io.File getDiskPathByDisk(@NotNull FileConfiguration configuration, int disk); static java.io.File getFilePathByPartition(@NotNull FileConfiguration configuration, int disk, int partition); static java.io.File getFilePathByPartition(@NotNull FileConfiguration configuration, @NotNull Partition partition); static File getOrCreateFile(@NotNull FileConfiguration configuration, @NotNull Partition partition); static ByteBuffer readFile(@NotNull File file, long offset, long length); static int writeFile(@NotNull File file, byte[] bytes, long offset); @NotNull static ByteBuffer readFile(@NotNull java.io.File javaFile); @NotNull static String readFileToString(@NotNull java.io.File javaFile); @NotNull static SortedMap<Long, Block> readBlob(@NotNull IndexService indexService, @NotNull File blob, @NotNull Partition partition); @NotNull static MerkleTree buildMerkleTree(
            @NotNull IndexService indexService,
            @NotNull File blob,
            @NotNull Partition partition
    ); static int getPercentOfDeleted(
            @NotNull FileConfiguration configuration,
            @NotNull IndexService indexService,
            @NotNull Partition partition
    );  }
@Test public void getPercentOfDeleted() { IndexElt expected = new IndexElt.IndexEltBuilder() .id(214803434770010112L) .type(1) .partition(new Partition(0, 0)) .offset(0L) .length(1L) .deleted(true) .metadata(ImmutableMap.of("key", "value")) .crc(42L) .updated(now(UTC).minusSeconds(indexConfiguration.getGcGraceTime() + 1).getMillis()) .build(); indexService.add(expected); assertEquals(FileUtils.getPercentOfDeleted(fileConfiguration, indexService, new Partition(0, 0)), 1); }