I need to write a method that returns a view of a List(java.util.List). The returned view should contain only those elements in the input List that returns true when tested with the isSuccessful() method.
List<Entity> getSuccessfulEntities(List<Entity> entities)
{
//Return a List view of entities, each element of which returns true for isSuccessful(entity)
}
I have looked at Collections and List API but couldn't find any facility for this. Any out of box thought?