Code example for ArrayList

Methods: addAll

0
 * A filter that matches Tasks containing the specified priorities 
 *  
 * @author Tim Barlotta 
 */ 
class ByPriorityFilter implements Filter<Task> { 
    ArrayList<Priority> priorities = new ArrayList<Priority>(); 
 
    public ByPriorityFilter(List<Priority> priorities) { 
        if (priorities != null) { 
            this.priorities.addAll(priorities); 
        } 
    } 
 
    @Override 
    public boolean apply(Task input) { 
        if (priorities.size() == 0) { 
            return true; 
        } 
 
        if (priorities.contains(input.getPriority())) { 
            return true;