Steps to Reproduce: 1. Set the date of adding the slot 2. Give the command addSlot Throwing an exception i.e Array Index Out of Bounds Need to handle this error. Given test case: @Test //Array index out of bounds exception void testAddNewSlot3() { ByteArrayOutputStream outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent)); String dateSet = "setNewDay|13-Oct-2020"; String [] dateParts = dateSet.split("\\|"); (new CmdSetDate()).execute(dateParts); String cmdLine = "addSlot"; String [] cmdParts = cmdLine.split("\\|"); (new CmdAddSlot()).execute(cmdParts); System.out.println(outContent.toString()); //String msg = "Checking when the size of the item is bigger than any slot"; assertEquals("Insufficient command arguments!", outContent.toString().trim().substring(outContent.toString().trim().lastIndexOf('\n')+1)); }