TarFiles implements Closeable { public long size() { long size = 0; Node head; lock.readLock().lock(); try { if (writer != null) { size = writer.fileLength(); } head = readers; } finally { lock.readLock().unlock(); } for (TarReader reader : iterable(head)) { size += reader.size(); } return size; } private  TarFiles(Builder builder); static Builder builder(); @Override void close(); @Override String toString(); long size(); int readerCount(); int segmentCount(); void flush(); boolean containsSegment(long msb, long lsb); Buffer readSegment(long msb, long lsb); void writeSegment(UUID id, byte[] buffer, int offset, int length, GCGeneration generation, Set<UUID> references, Set<String> binaryReferences); CleanupResult cleanup(CleanupContext context); void collectBlobReferences(Consumer<String> collector, Predicate<GCGeneration> reclaim); Iterable<UUID> getSegmentIds(); Map<UUID, Set<UUID>> getGraph(String fileName); Map<String, Set<UUID>> getIndices(); FileReaper createFileReaper();  }
@Test public void testInitialSize() throws Exception { assertEquals(0, tarFiles.size()); }