### Question:
LogResponse { @NonNull public static LogResponse fromJson(@NonNull Reader reader) throws IOException { JsonReader jsonReader = new JsonReader(reader); try { jsonReader.beginObject(); while (jsonReader.hasNext()) { String name = jsonReader.nextName(); if (name.equals("nextRequestWaitMillis")) { if (jsonReader.peek() == JsonToken.STRING) { return LogResponse.create(Long.parseLong(jsonReader.nextString())); } else { return LogResponse.create(jsonReader.nextLong()); } } jsonReader.skipValue(); } throw new IOException("Response is missing nextRequestWaitMillis field."); } finally { jsonReader.close(); } }  abstract long getNextRequestWaitMillis(); @NonNull static LogResponse fromJson(@NonNull Reader reader);  }### Answer:
@Test public void testLogRequestParsing_emptyJson() throws IOException { Assert.assertThrows(IOException.class, () -> LogResponse.fromJson(new StringReader(""))); }
@Test public void testLogRequestParsing_invalidJsonObjectIncomplete() throws IOException { Assert.assertThrows( IOException.class, () -> LogResponse.fromJson(new StringReader("{\"nextRequestWaitMillis\":"))); }
@Test public void testLogRequestParsing_invalidJsonObjectNotClosed() throws IOException { Assert.assertThrows(IOException.class, () -> LogResponse.fromJson(new StringReader("{"))); }
@Test public void testLogRequestParsing_invalidJsonObjectNotOpen() throws IOException { Assert.assertThrows( IOException.class, () -> LogResponse.fromJson(new StringReader("\"nextRequestWaitMillis\":3}"))); }
@Test public void testLogRequestParsing_invalidJsonInvalid() throws IOException { Assert.assertThrows( IOException.class, () -> LogResponse.fromJson(new StringReader("{\"nextRequestWaitMillis\":}"))); }