How to mock a constructor - Junit test case development issuesWhile writing JUnit test cases, we encounter cases like we want to initialize a…