### Question:
StockOnHandGraphBar { protected int getRelativeHeight(int givenValue, int maxValue, int maxHeight) { try { return (maxHeight * givenValue) / maxValue; } catch (Exception e) { return 0; } } StockOnHandGraphBar(String commodityName, int min, int max,
                               int monthsOfStockOnHand, int color, int actualStockOnHand);  StockOnHandGraphBar(); RelativeLayout getView(Context applicationContext, int biggestValue, int height); @Override String toString();  }### Answer:
@Test public void shouldCalculateTheCorrectRelativeHeight() throws Exception { StockOnHandGraphBar stockOnHandGraphBar = new StockOnHandGraphBar(); assertThat(stockOnHandGraphBar.getRelativeHeight(80, 100, 100), is(80)); assertThat(stockOnHandGraphBar.getRelativeHeight(382, 394, 298), is(288)); }