我想实现 java 代码来根据相似的属性对项目进行分组。假设我有一系列客户存储以下信息 Name , City , Language , Car , Company
Customer1= { Mahesh, Mumbai , Hindi , Maruti , Infy}
Customer2= { Robin, Mumbai, English , Honda , Wipro}
Customer3 = { Mahek, Mumbai, Hindi, Maruti, Wipro}
Customer4 = { Rohit, Mumbai, English, Honda, Infy}
Customer5 = { Yogesh, Delhi, English, Honda, ''}
Customer6 = { Alpesh, Delhi, English, '', TCS}
Customer7 = { Mark, Delhi, English, '', WIPRO}
现在我正在寻找的是我可以创建一组具有相似城市、语言和汽车的客户
所以我应该有4组
Group 1 = Customer1 , Customer3
Group 2 = Customer2 , Customer4
GROUP 3 = Customer5
Group 4 = Customer6 ,Customer7
基本上我想根据一些类似的属性对项目进行分组。我如何在 Java 中有效地实现这一点