принимаю с сервера такой json
{"result":"success","message":"services ok","services":[{"id":"1","service_name":"\u041f\u0430\u0440\u0438\u043a\u043c\u0430\u0445\u0435\u0440\u0441\u043a\u0430\u044f","parent":"0"},
{"id":"2","service_name":"\u041d\u043e\u0433\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441","parent":"0"},
{"id":"3","service_name":"\u0422\u0430\u0442\u0443","parent":"0"},
{"id":"4","service_name":"\u041c\u0430\u043a\u0438\u044f\u0436","parent":"0"},
{"id":"5","service_name":"\u041a\u043e\u0441\u043c\u0435\u0442\u043e\u043b\u043e\u0433\u0438\u044f","parent":"0"},
{"id":"6","service_name":"\u0416\u0435\u043d\u0441\u043a\u0438\u0439 \u0437\u0430\u043b","parent":"1"},
{"id":"7","service_name":"\u041c\u0443\u0436\u0441\u043a\u043e\u0439 \u0437\u0430\u043b","parent":"1"},
{"id":"8","service_name":"\u0414\u0435\u0442\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u0438\u0436\u043a\u0438","parent":"1"},{"id":"9","service_name":"\u0425\u0430\u0438\u0440 \u0442\u0430\u0442\u0443","parent":"1"},
{"id":"10","service_name":"\u041a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0431\u0440\u043e\u0432\u0435\u0439","parent":"1"},
{"id":"11","service_name":"\u041c\u0430\u043d\u0438\u043a\u044e\u0440","parent":"2"},{"id":"12","service_name":"\u041f\u0435\u0434\u0438\u043a\u044e\u0440","parent":"2"},{"id":"13","service_name":"\u0421\u0432\u0430\u0434\u0435\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0435\u0441\u043a\u0438","parent":"6"},{"id":"14","service_name":"\u0421\u0442\u0440\u0438\u0436\u043a\u0438","parent":"6"},
{"id":"15","service_name":"\u0412\u0435\u0447\u0435\u0440\u043d\u0438\u0435 \u043f\u0440\u0438\u0447\u0435\u0441\u043a\u0438","parent":"6"},{"id":"16","service_name":"\u0423\u043a\u043b\u0430\u0434\u043a\u0430","parent":"6"},{"id":"17","service_name":"\u041e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u0435","parent":"6"},{"id":"18","service_name":"\u0412\u044b\u043f\u0440\u044f\u043c\u043b\u0435\u043d\u0438\u0435","parent":"6"},{"id":"19","service_name":"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u043b\u043e\u0441","parent":"6"},
{"id":"20","service_name":"\u041f\u0440\u0438\u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043c","parent":"6"},
{"id":"21","service_name":"\u041a\u0435\u0440\u0430\u0442\u0438\u043d\u043e\u0432\u043e\u0435 \u0440\u0430\u0437\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u0435","parent":"6"},{"id":"22","service_name":"\u0413\u043e\u0440\u044f\u0447\u0438\u0435 \u043d\u043e\u0436\u043d\u0438\u0446\u044b","parent":"6"},{"id":"23","service_name":"\u0411\u043e\u043d\u0434\u0438\u043d\u0433","parent":"6"},{"id":"24","service_name":"\u0421\u0442\u0440\u0438\u0436\u043a\u0438","parent":"7"},{"id":"25","service_name":"\u0423\u0445\u043e\u0434 \u0437\u0430 \u0431\u043e\u0440\u043e\u0434\u043e\u0439","parent":"7"},
{"id":"26","service_name":"\u042f\u043f\u043e\u043d\u0441\u043a\u0438\u0439 \u043c\u0430\u043d\u0438\u043a\u044e\u0440","parent":"11"},
{"id":"27","service_name":"\u041f\u0430\u0440\u0430\u0444\u0438\u043d\u043e\u0442\u0435\u0440\u0430\u043f\u0438\u044f","parent":"11"},
{"id":"28","service_name":"\u0427\u0438\u0441\u0442\u043a\u0430 \u043b\u0438\u0446\u0430","parent":"5"},
{"id":"29","service_name":"\u041f\u0438\u043b\u0438\u043d\u0433","parent":"5"},{"id":"30","service_name":"\u0411\u0438\u043e\u0440\u0435\u0432\u0438\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f","parent":"5"},
{"id":"31","service_name":"\u0428\u0443\u0433\u0430\u0440\u0438\u043d\u0433","parent":"5"},
{"id":"32","service_name":"\u0414\u0435\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432\u043e\u0441\u043a\u043e\u043c","parent":"5"}]}
далее создаю новый класс
public class Services {
private String id;
private String service_name;
private String parent;
public String getId() {
return id;
}
public String getService_name() {
return service_name;
}
public String getParent() {
return parent;
}
}
создаю список
List<Services> services = resp.getServices();
как мне отфильтровать новый список по значению parent = 0