Steps to Reproduce: 1. Give the item of size 5 along with the arrival and the departure dates. 2. Give the slot size of 10. Throwing an exception i.e Array Index Out of Bounds for findOnePerfectFit in the optimize method! Given test case: @Test void testOptimize5() { Item is = new Item(5, new Day("13-Oct-2020"),new Day("20-Oct-2020")); Slot ss = new Slot(10); ArrayList<Item> itemArray = new ArrayList<Item>(); itemArray.add(is); Optimize opt = new Optimize(); opt.findOnePerfectFit(itemArray, ss); assertEquals(false, opt.getFound()); }