How to get item size in Vaadin8 combobox?

I’m trying to show a pop-up if there is no any item in Vaadin8 combobox. But there is no getItems() or size() methods.
here is my code, if branch size = 0 I want to push a notification to user.

cbxBranch = new ComboBox<>();
cbxBranch.setPlaceholder("Select a branch");
cbxBranch.setItemCaptionGenerator(Branch::getBranchName);
cbxBranch.setEmptySelectionAllowed(false);
cbxBranch.setItems(getBranches());
cbxBranch.addFocusListener(e -> {
  //this line just a sample.. 
  System.out.println(cbxBranch.getDataProvider().size());
});
cbxBranch.addFocusListener(e -> {
 if (((ListDataProvider<Branch>) cbxBranch.getDataProvider()).getItems().isEmpty()) {         Notification.show("You don't have a branch!", Type.WARNING_MESSAGE);
 }
});

If you happen to use ComboBox with default data provider, it is ListDataProvider (so you can cast it to it) and it has getItems() for getting the Collection of underlying data items.