Необходимо сгруппировать список HashMaps в список HashMaps с одинаковыми временными метками на основе ключа.
Map<String, Object> m0 = new HashMap<>();
m0.put("x", "aaa#0322");
m0.put("y", "saadaad");
m0.put("z", "7asasada89");
Map<String, Object> m1 = new HashMap<>();
m1.put("x", "bbb#0314");
m1.put("y", "asasadafa");
m1.put("z", "daasaada");
Map<String, Object> m2 = new HashMap<>();
m2.put("x", "bbb#0322");
m2.put("y", "asasdfaff");
m2.put("z", "2sadada22");
List<Map> l = new ArrayList<>(Arrays.asList(m0, m1, m2));
[{x = aaa # 0322, y = saadaad, z = 7asasada89},{x = bbb # 0314, y = asasadafa, z = daasaada}, {x = bbb # 0322, y = asasdfaff, z = 2sadada22}, {x = bbb # 0314, y = bsaadda, z = asfasaafe}]
Convert to a format where i can group it according to timestamp value in x like x#0322
[
[
{x=aaa#0322, y=saadaad, z=7asasada89}, {x=bbb#0322, y=asasdfaff, z=2sadada22}
],
[
{x=bbb#0314, y=asasadafa, z=daasaada}, {x=bbb#0314, y=bsaadda, z=asfasaafe}
]
]
Or Convert to a format where i can group it according to timestamp value in x like x#0322
[
{
{x=aaa#0322, y=saadaad, z=7asasada89}, {x=bbb#0322, y=asasdfaff, z=2sadada22}
},
{
{x=bbb#0314, y=asasadafa, z=daasaada}, {x=bbb#0314, y=bsaadda, z=asfasaafe}
}
]