public List<Item> extractPurchaseItems(String targetCode, List<Item> list,
			int required) {

		List<Item> result = new ArrayList<Item>();

		int actualHitCount = 0;
		for (Item i : list) {
			if (targetCode.equals(i.getItemCode())) {
				actualHitCount++;
			}
			if (actualHitCount == required) {
				break;
			}
		}

		if (actualHitCount != required)
			return result;

		Iterator<Item> iter = list.iterator();
		while (iter.hasNext()) {

			Item i = iter.next();
			if (targetCode.equals(i.getItemCode())) {
				result.add(i);
				iter.remove();
				actualHitCount--;
			}

			if (actualHitCount == 0)
				break;

		}

		return result;

	}