grouping transactions by item name java