Thanks @Vijendra1. Could you also please provide me the codes that can avoid this by using the org.mockito.Mockito.mockConstruction to simulate the behavior of Document, ProcessInputXML, and TableOfContent and approach avoids initializing the actual Document object and its dependencies, which may...