### Question:
ProfileDataItem implements Comparable<ProfileDataItem<T>> { @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT) public BigDecimal getVerticalTo() { return isSetVerticalFrom() ? this.vertical : null; } ProfileDataItem();  ProfileDataItem(BigDecimal vertical, T value);  ProfileDataItem(BigDecimal verticalFrom, BigDecimal verticalTo, T value); BigDecimal getVerticalFrom(); @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT) void setVerticalFrom(BigDecimal verticalFrom); @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT) BigDecimal getVerticalTo(); @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT) BigDecimal getVertical(); void setVertical(BigDecimal vertical); @JsonInclude(content = Include.ALWAYS) T getValue(); void setValue(T value); @JsonIgnore void setValueFormatter(ValueFormatter<T> valueFormatter); @JsonIgnore String getFormattedValue(); DetectionLimitOutput getDetectionLimit(); void setDetectionLimit(DetectionLimitOutput detectionLimit); @Override int compareTo(ProfileDataItem<T> o); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void getVerticalTo_when_verticalFromIsNull() { ProfileDataItem<Object> value = new ProfileDataItem<>(BigDecimal.valueOf(1L), null); MatcherAssert.assertThat("verticalTo is null", value.getVerticalTo(), IsNull.nullValue()); }
@Test public void getVerticalTo_when_verticalFromIsNotNull() { ProfileDataItem<Object> value = new ProfileDataItem<>(BigDecimal.valueOf(1L), BigDecimal.valueOf(2L), null); MatcherAssert.assertThat("verticalTo is null", value.getVerticalTo(), IsNull.notNullValue()); MatcherAssert.assertThat("verticalTo is not of value 2L", value.getVerticalTo(), is(BigDecimal.valueOf(2L))); }