FileContentDelegate mockFileContentDelegate = mock(FileContentDelegate.class);
PowerMockito.whenNew(FileContentDelegate.class).withArguments(any(File.class), isNull(), isNull())
.thenReturn(mockFileContentDelegate);
when(mockFileContentDelegate.getSHA(any(File.class))).thenReturn("abcd1234");
JarContentFileInfo mockJarContentFileInfo = mock(JarContentFileInfo.class);
PowerMockito.whenNew(JarContentFileInfo.class).withParameterTypes(File.class).withArguments(any(File.class))
.thenReturn(mockJarContentFileInfo);
when(mockJarContentFileInfo.getVersion(isNull(String.class))).thenReturn("testDisplayVersion");
//create object to test and inject required dependencies
when(objectUnderTest.discoverDeployedPackages(any(PackageType.class))).thenCallRealMethod();
//run code under test