List<ShareSource> sources, int[] differencesInSeconds,
List<Resource> resources) {
List<ResourceWithAssignedDuration> result = new ArrayList<ResourceWithAssignedDuration>();
int differencesIndex = 0;
for (int i = 0; i < resources.size(); i++) {
Resource resource = resources.get(i);
ShareSource shareSource = sources.get(i);
final int differencesToTake = shareSource.shares.size();
int sum = sumDifferences(differencesInSeconds, differencesIndex,
differencesToTake);
differencesIndex += differencesToTake;