What would be the best practice to use ComboBox for data gathered from an o

Have a comboBox that shows list of objects I get from outside rest service in JSON. Currently made it this way, getting first 1000 objects and if there is no suitable one I attached a New Item handler that makes a new request with entered text as a query. So I am wondering is there another better way.

Here is some of my code:

private VerticalLayout addLayout () {
Collection initialCollection = service.getResults();
ComboBox university = new ComboBox("University", initialCollection );
addComponent(university);
university.setNewItemHandler(newItemCaption -> {
initialCollection.removeAllItems();
bindItemsToComboBox(university, service.getResults(newItemCaption) );
});
return layout;
}

public static void bindItemsToComboBox(ComboBox comboBox, Collection items){
for (Object o : items){
comboBox.addItem(o);
comboBox.setItemCaption(o,o.toString());
}
}