### Question:
ParserWrapper implements Parser { @Override public BigDecimal getDecimal() throws MatchbookSDKParsingException { if (isNotNullValue()) { try { return jsonParser.getDecimalValue(); } 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 decimal value") void getDecimalTest() throws IOException { BigDecimal expectedResult = new BigDecimal("42"); when(jsonParser.getDecimalValue()).thenReturn(expectedResult); when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(false); BigDecimal result = unit.getDecimal(); assertThat(result).isNotNull(); assertThat(result).isEqualByComparingTo(expectedResult); }
@Test @DisplayName("Read null decimal value") void getDecimalNullTest() { when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(true); BigDecimal result = unit.getDecimal(); assertThat(result).isNull(); }
@Test @DisplayName("Exception reading time instant value") void getDecimalFailedTest() throws IOException { doThrow(IOException.class).when(jsonParser).getDecimalValue(); when(jsonParser.hasToken(JsonToken.VALUE_NULL)).thenReturn(false); assertThatExceptionOfType(MatchbookSDKParsingException.class) .isThrownBy(() -> unit.getDecimal()); }