### Question:
JSONFileReader implements Closeable { public T getNext() throws IOException { if (readingAsStream) { JsonToken token = parser.nextToken(); if (token == JsonToken.END_ARRAY || token == null) { return null; } return JSONMapper.Mapper.readValue(parser, dataClass); } else { throw new IllegalStateException("Must have called startStream before calling getNext."); } } JSONFileReader(File file, Class<T> dataClass); long getFileSize(); long getFilePosition(); void startStream(); T getNext(); List<T> getAll(); @Override void close();  }### Answer:
@Test public void readAsStreamWithoutStartingStreamTest() { File inputFile = new File("src/test/resources/many_clients.json"); assertThrows(IllegalStateException.class, () -> { try (JSONFileReader<Client> clientFileReader = new JSONFileReader<>(inputFile, Client.class)) { clientFileReader.getNext(); } }); }