DefaultVersionInstaller implements VersionInstaller { @Override public OngoingInstallation install(Version latestVersion) { return transfer.transferVersionTo(latestVersion, receptacle); } DefaultVersionInstaller(VersionTransfer transfer, VersionReceptacle receptacle); @Override OngoingInstallation install(Version latestVersion);  }
@Test public void handsOutInstallationFromTransfer() throws Exception { OngoingInstallation installation = mock(Installation.class); Version version = mock(Version.class); when(transfer.transferVersionTo(version, receptacle)).thenReturn(installation); OngoingInstallation install = installer.install(version); assertThat(install, is(installation)); }