@Test public void testGetPurchase() throws Exception {

    Inventory inventory = new Inventory();
    Purchase p = mock(Purchase.class);
    when(p.getSku()).thenReturn("sku1");
    inventory.addPurchase(p);
    assertThat(inventory.getPurchase("sku1")).isSameAs(p);
}