Filter data based on condition from collection in the fastest way in java : i have a custom array list with almost 600 entry what my requirement is i need to filter some value based on some condition i try basic loop stuff but its very time taking process, what i want is the fastest way to filter the data.
     
    public class MyModel {
    private boolean attempeted = false;
    private String answer;
    
    public MyModel(String answer) {
        this.answer = answer;
    }
    
    public void setAttempted(boolean attempeted) {
        this.attempeted = attempeted;
    }
    
    public String getAnswer() {
        return answer;
    }
       
    public boolean isAttempeted() {
        return attempeted;
    }
    
    }

The above is my model what i want is i need to get only data having **attempeted value true** 

what i did is 

    ArrayList<TestAnswerModel>myMainArrayList=array which contain all my data
    ArrayList<TestAnswerModel>filterArrayList=new ArrayList<>();
    for(int i=0;i<myMainArrayList.size();i++)
        {
            if(myMainArrayList.get(i).isAttempeted()) {
                filterArrayList.add(myMainArrayList.get(i))
            }
        }


The above is working fine but if my data is too large it is take lot of time also some times the data will be 600 and the attempted value only true for 2 or 3 values so this looping will happened without any result.

What i want any fastest method to filter the data,i search the web and stack overflow but i don't find a good solution am new to java and programming world please help me out.
Thank you



