@Test public void shouldNotBeAbleToTakeItemWhenItWasNotPlacedBefore() { ItemsContainer itemsContainer = new ItemsContainer(1); boolean result = itemsContainer.canTakeItem(1); Assert.assertEquals(false, result); }
@Override public boolean canTakeItem(int itemId) { return items.stream() .anyMatch(item -> item.getId() == itemId); }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean canTakeItem(int itemId) { return items.stream() .anyMatch(item -> item.getId() == itemId); } }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean canTakeItem(int itemId) { return items.stream() .anyMatch(item -> item.getId() == itemId); } ItemsContainer(int containerCapacity);  ItemsContainer(Document document); }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean canTakeItem(int itemId) { return items.stream() .anyMatch(item -> item.getId() == itemId); } ItemsContainer(int containerCapacity);  ItemsContainer(Document document); @Override char getMapInfo(); @Override boolean placeItem(Item item); @Override void takeItem(int itemId); @Override boolean canTakeItem(int itemId); @Override JSONObject jsonSerialise(); @Override Document mongoSerialise(); }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean canTakeItem(int itemId) { return items.stream() .anyMatch(item -> item.getId() == itemId); } ItemsContainer(int containerCapacity);  ItemsContainer(Document document); @Override char getMapInfo(); @Override boolean placeItem(Item item); @Override void takeItem(int itemId); @Override boolean canTakeItem(int itemId); @Override JSONObject jsonSerialise(); @Override Document mongoSerialise();  }