### Question:
Adjustment implements Serializable, Snapshotable { @Override public List<CommoditySnapshotValue> getActivitiesValues() { List<CommoditySnapshotValue> values = new ArrayList<>(); int adjustmentQuantity = isPositive() ? quantity : quantity * -1; values.add(new CommoditySnapshotValue(commodity.getCommodityAction(DataElementType.ADJUSTMENTS.getActivity()), adjustmentQuantity)); values.add(new CommoditySnapshotValue(commodity.getCommodityAction(DataElementType.ADJUSTMENT_REASON.getActivity()), reason)); return values; } 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 shouldSelectCorrectCommodityActions() throws Exception { Commodity commodity = mock(Commodity.class); CommodityAction adjustmentReasonsAction = new CommodityAction(commodity, "12", "12", DataElementType.ADJUSTMENT_REASON.toString()); CommodityAction adjustmentAmountAction = new CommodityAction(commodity, "12", "12", DataElementType.ADJUSTMENTS.toString()); when(commodity.getCommodityAction(DataElementType.ADJUSTMENTS.toString())).thenReturn(adjustmentAmountAction); when(commodity.getCommodityAction(DataElementType.ADJUSTMENT_REASON.toString())).thenReturn(adjustmentReasonsAction); Adjustment adjustment = new Adjustment(commodity, 10, false, "Count"); assertThat(adjustment.getActivitiesValues().size(), is(2)); assertThat(adjustment.getActivitiesValues().get(0).getValue(), is("-10")); assertThat(adjustment.getActivitiesValues().get(1).getValue(), is("Count")); assertThat(adjustment.getActivitiesValues().get(0).getCommodityAction(), is(notNullValue())); assertThat(adjustment.getActivitiesValues().get(1).getCommodityAction(), is(notNullValue())); }