There is an ArrayList with objects, say, Item . Each object has a field Long id , Long parentId and List subitems , where the same Item objects lie, or else it is empty. It is necessary to go through the list, find such an Item that is a subitem of an Item that is already on the same list, and delete such subitem.
The unpleasant limitation is Java 7 + Guava, since the streams on Android were not delivered.
idor throughequals? - Nofate ♦id. - Bringoff