I have a list of Schools List<Schools> and want to filer out the blacklisted schools. I want to filter out the blacklisted schools using Java 8. How should I do it. Is Java 8 streams the best way.
<Please, forgive my punctuations, some keyboard keys are not working>. Ex if List<Schools> contain School A, School B, School C. And BlackListed school is B. Final Result should be A and C.
Schools.java
public class Schools{
public String className;
public String schoolCode;
}
BlackListedSchools.java
public class BlackListedSchools
{
public School school;
public School getSchool()
{
return this.school;
}
}
public School
{
public String className;
public String schoolCode;
}