### Question:
Adjustment implements Serializable, Snapshotable { public String getType() { if (positive) { return "+"; } return "-"; } Adjustment();  Adjustment(Commodity commodity, int quantityEntered,
                      boolean positive, String reason);  Adjustment(Commodity commodity, int quantityEntered, int quantityAllocated,
                      boolean positive, String reason); Commodity getCommodity(); @Override List<CommoditySnapshotValue> getActivitiesValues(); @Override Date getDate(); int getQuantity(); long getId(); boolean isPositive(); String getReason(); String getType(); int getNewStockOnHand(); Date getCreated(); void setCreated(Date created); int getAllocated(); void setAllocated(int allocated);  }### Answer:
@Test public void shouldReturnPlusIfPositive() throws Exception { Commodity commodity = mock(Commodity.class); when(commodity.getStockOnHand()).thenReturn(20); Adjustment adjustment = new Adjustment(commodity, 10, true, "Count"); assertThat(adjustment.getType(), is("+")); }
@Test public void shouldReturnMinusIfNotPositive() throws Exception { Commodity commodity = mock(Commodity.class); when(commodity.getStockOnHand()).thenReturn(20); Adjustment adjustment = new Adjustment(commodity, 10, false, "Count"); assertThat(adjustment.getType(), is("-")); }