public List<IInstallableUnit> listIUs(final URI location) {
List<IInstallableUnit> _xifexpression = null;
String _string = location.toString();
boolean _equals = "http://download.eclipse.org/tools/orbit/downloads/drops/R20130517111416/repository/".equals(_string);
if (_equals) {
Version _createOSGi = Version.createOSGi(10, 0, 0);
MockIU _mockIU = new MockIU("com.google.guava", _createOSGi);
Version _createOSGi_1 = Version.createOSGi(11, 0, 2);
MockIU _mockIU_1 = new MockIU("com.google.guava", _createOSGi_1);
Version _createOSGi_2 = Version.createOSGi(12, 0, 0);
MockIU _mockIU_2 = new MockIU("com.google.guava", _createOSGi_2);
_xifexpression = CollectionLiterals.<IInstallableUnit>newImmutableList(_mockIU, _mockIU_1, _mockIU_2);
} else {
return CollectionLiterals.<IInstallableUnit>emptyList();
}
return _xifexpression;
}
});
NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
targetDef.resolve(_mockMetadataRepositoryManager, _nullProgressMonitor);
String _name = targetDef.getName();
Assert.assertEquals("TP1", _name);
List<ResolvedLocation> _locations = targetDef.getLocations();
int _size = _locations.size();
Assert.assertEquals(1, _size);
List<ResolvedLocation> _locations_1 = targetDef.getLocations();
final Function1<ResolvedLocation, List<String>> _function = new Function1<ResolvedLocation, List<String>>() {
public List<String> apply(final ResolvedLocation it) {
List<IInstallableUnit> _resolvedIUs = it.getResolvedIUs();
final Function1<IInstallableUnit, String> _function = new Function1<IInstallableUnit, String>() {
public String apply(final IInstallableUnit it) {
return it.getId();
}
};
return ListExtensions.<IInstallableUnit, String>map(_resolvedIUs, _function);
}
};
List<List<String>> _map = ListExtensions.<ResolvedLocation, List<String>>map(_locations_1, _function);
final String[] ids = ((String[])Conversions.unwrapArray(Iterables.<String>concat(_map), String.class));
List<ResolvedLocation> _locations_2 = targetDef.getLocations();
final Function1<ResolvedLocation, List<Version>> _function_1 = new Function1<ResolvedLocation, List<Version>>() {
public List<Version> apply(final ResolvedLocation it) {
List<IInstallableUnit> _resolvedIUs = it.getResolvedIUs();
final Function1<IInstallableUnit, Version> _function = new Function1<IInstallableUnit, Version>() {
public Version apply(final IInstallableUnit it) {
return it.getVersion();
}
};
return ListExtensions.<IInstallableUnit, Version>map(_resolvedIUs, _function);
}
};
List<List<Version>> _map_1 = ListExtensions.<ResolvedLocation, List<Version>>map(_locations_2, _function_1);
final Version[] versions = ((Version[])Conversions.unwrapArray(Iterables.<Version>concat(_map_1), Version.class));
int _size_1 = ((List<String>)Conversions.doWrapArray(ids)).size();
Assert.assertEquals(1, _size_1);
Object _head = IterableExtensions.<Object>head(((Iterable<Object>)Conversions.doWrapArray(ids)));
Assert.assertEquals("com.google.guava", _head);
Version _head_1 = IterableExtensions.<Version>head(((Iterable<Version>)Conversions.doWrapArray(versions)));
String _string = _head_1.toString();
Assert.assertEquals("11.0.2", _string);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}