Note: Bug in Version 3 Steps to Reproduce: 1. Give the dimensions of item like size, arrival and departure date. 2. Give the size of the slot Below is the test case which threw error: @Test void testOptimize3() { Item is = new Item(-1, new Day("13-Oct-2020"),new Day("20-Oct-2020")); Slot ss = new Slot(5); ArrayList<Item> itemArray = new ArrayList<Item>(); itemArray.add(is); Optimize opt = new Optimize(); opt.findOnePerfectFit(itemArray, ss); assertEquals(false, opt.getFound()); } Error: ArrayIndexOutOfBoundsException was thrown.