}
@Override
public Hardware apply(Iterable<ProductItem> items) {
ProductItem coresItem = getOnlyElement(filter(items, matches(cpuDescriptionRegex)));
ProductItem ramItem = getOnlyElement(filter(items, categoryCode(RAM_CATEGORY)));
ProductItem volumeItem = get(filter(items, categoryCode(FIRST_GUEST_DISK)), 0);
String hardwareId = hardwareId().apply(ImmutableList.of(coresItem, ramItem, volumeItem));
double cores = ProductItems.capacity().apply(coresItem).doubleValue();
Matcher cpuMatcher = cpuDescriptionRegex.matcher(coresItem.getDescription());
double coreSpeed = (cpuMatcher.matches()) ? Double.parseDouble(cpuMatcher.group(cpuMatcher.groupCount())) : DEFAULT_CORE_SPEED;