SelectMultiMinimalWidget extends SelectMinimalWidget { @Override public void setBinaryData(Object answer) { selectedItems = (List<Selection>) answer; updateAnswerLabel(); widgetValueChanged(); } SelectMultiMinimalWidget(Context context, QuestionDetails prompt); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setBinaryData(Object answer); @Override void setChoiceSelected(int choiceIndex, boolean isSelected);  }
@Test public void whenAnswerChanges_shouldValueChangeListenersBeCalled() { WidgetValueChangedListener valueChangedListener = mockValueChangedListener(getSpyWidget()); SelectMultiData answer = getInitialAnswer(); Selection selectedChoice = ((List<Selection>) answer.getValue()).get(0); getSpyWidget().setBinaryData(Collections.singletonList(selectedChoice)); verify(valueChangedListener).widgetValueChanged(getSpyWidget()); }