@Test public void shouldNotPlaceItemWhenThereIsNoCapacityLeft() { ItemsContainer itemsContainer = new ItemsContainer(1); itemsContainer.placeItem(new ItemCopper()); boolean result = itemsContainer.placeItem(new ItemCopper()); Assert.assertEquals(false, result); }
@Override public boolean placeItem(Item item) { if (items.size() < containerCapacity) { items.add(item); return true; } else { return false; } }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean placeItem(Item item) { if (items.size() < containerCapacity) { items.add(item); return true; } else { return false; } } }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean placeItem(Item item) { if (items.size() < containerCapacity) { items.add(item); return true; } else { return false; } } ItemsContainer(int containerCapacity);  ItemsContainer(Document document); }
ItemsContainer extends GameObject implements InventoryHolder { @Override public boolean placeItem(Item item) { if (items.size() < containerCapacity) { items.add(item); return true; } else { return false; } } 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 placeItem(Item item) { if (items.size() < containerCapacity) { items.add(item); return true; } else { return false; } } 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();  }