### Question:
FileBlockSpliterator implements Spliterator<FileBlock> { @Override public boolean tryAdvance(Consumer<? super FileBlock> action) { try { int headerSize = input.readInt(); byte[] headerData = new byte[headerSize]; input.readFully(headerData); Fileformat.BlobHeader header = Fileformat.BlobHeader.parseFrom(headerData); int blobSize = header.getDatasize(); byte[] blobData = new byte[blobSize]; input.readFully(blobData); Fileformat.Blob blob = Fileformat.Blob.parseFrom(blobData); action.accept(new FileBlock( FileBlock.Type.valueOf(header.getType()), header.getIndexdata(), data(blob), 8 + headerSize + blobSize)); return true; } catch (Exception e) { return false; } } FileBlockSpliterator(DataInputStream input); @Override Spliterator<FileBlock> trySplit(); @Override long estimateSize(); @Override int characteristics(); @Override boolean tryAdvance(Consumer<? super FileBlock> action);  }### Answer:
@Test public void tryAdvance() { Spliterator<FileBlock> spliterator = new FileBlockSpliterator(new DataInputStream(dataOsmPbf())); spliterator.forEachRemaining(fileBlock -> assertNotNull(fileBlock)); assertFalse(spliterator.tryAdvance(new HoldingConsumer<>())); }