### Question:
Inventory { public void addSkuDetails(SkuDetails d) { mSkuMap.put(d.getSku(), d); }  SkuDetails getSkuDetails(String sku); Collection<SkuDetails> getSkuDetails(); Purchase getPurchase(String sku); boolean hasPurchase(String sku); boolean hasDetails(String sku); void erasePurchase(String sku); List<String> getAllOwnedSkus(); List<String> getAllOwnedSkus(ItemType itemType); List<Purchase> getAllPurchases(); void addSkuDetails(SkuDetails d); void addPurchase(Purchase p); @Override String toString();  }### Answer:
@Test public void testAddSkuDetails() throws Exception { Inventory inventory = new Inventory(); SkuDetails details = mock(SkuDetails.class); when(details.getSku()).thenReturn("sku1"); inventory.addSkuDetails(details); assertThat(inventory.getSkuDetails()).hasSize(1); }