RouteOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { private List<String> getLabels() { final List<String> labels = new ArrayList<>(mResourcesKey.length); for (final int id : mResourcesKey) { labels.add(getString(id)); } return labels; } RouteOptionsPanel(final Context context);  RouteOptionsPanel(final Context context, final AttributeSet attrs);  RouteOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  RouteOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); RouteOptions getRouteOptions(); void setRouteOptions(final RouteOptions routeOptions); @SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NcssCount"}) void populateRouteOptions(); @Override void onChanged(OptionItem item);  }
@Test public void testInitUiFunction() { final List<OptionItem> items = mRouteOptionsPanel.getOptionItems(); assertThat(items.size(), equalTo(1)); MultipleChoiceOptionItem item = (MultipleChoiceOptionItem) items.get(0); final List<String> labels = item.getLabels(); assertThat(labels.size(), equalTo(8)); List<String> selectedIds = item.getSelectedLabels(); assertThat(selectedIds.size(), equalTo(0)); assertThat(labels, hasItem(getString(R.string.msdkui_allow_car_pool))); item.selectLabels(Collections.singletonList(getString(R.string.msdkui_allow_car_pool))); selectedIds = item.getSelectedLabels(); assertThat(selectedIds.size(), equalTo(1)); }