### Question:
ParserWrapper implements Parser { @Override public Double getDouble() throws MatchbookSDKParsingException { if (isNotNullValue()) { try { return jsonParser.getValueAsDouble(); } catch (IOException e) { throw new MatchbookSDKParsingException(e); } } return null; } ParserWrapper(JsonFactory jsonFactory, InputStream inputStream); @Override boolean hasCurrentToken(); @Override boolean isEndOfObject(); @Override boolean isEndOfArray(); @Override void moveToNextToken(); @Override void moveToNextValue(); @Override void skipChildren(); @Override String getFieldName(); @Override Boolean getBoolean(); @Override String getString(); @Override Integer getInteger(); @Override Long getLong(); @Override Double getDouble(); @Override BigDecimal getDecimal(); @Override Instant getInstant(); @Override T getEnum(Class<T> enumClass); @Override void close();  }### Answer:
@Test @DisplayName("Read double value") void getDoubleTest() throws IOException { Double expectedResult = 42.0; when(jsonParser.getValueAsDouble()).thenReturn(expectedResult); when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(false); Double result = unit.getDouble(); assertThat(result).isNotNull(); assertThat(result).isEqualTo(expectedResult); }
@Test @DisplayName("Read null double value") void getDoubleNullTest() { when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(true); Double result = unit.getDouble(); assertThat(result).isNull(); }
@Test @DisplayName("Exception reading double value") void getDoubleFailedTest() throws IOException { doThrow(IOException.class).when(jsonParser).getValueAsDouble(); when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(false); assertThatExceptionOfType(MatchbookSDKParsingException.class) .isThrownBy(() -> unit.getDouble()); }