NumericOptionItem extends OptionItem { public NumericOptionItem setValue(final Number value) { mOutput = value; if (value == null || Float.isNaN(value.floatValue())) { mValueView.setText(getContext().getString(R.string.msdkui_undefined)); } else { mValueView.setText(String.valueOf(value)); } notifyChange(); return this; } NumericOptionItem(final Context context);  NumericOptionItem(final Context context, final AttributeSet attrs);  NumericOptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  NumericOptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); Number getValue(); NumericOptionItem setValue(final Number value); String getLabel(); NumericOptionItem setLabel(final String labelId); NumericOptionItem setInputType(int inputType);  }
@Test public void testSetValue() { Number value = 5; final TextView valueView = mNumericOptionItem.findViewById(R.id.numeric_item_value); assertNotNull(valueView); mNumericOptionItem.setValue(value); assertEquals(String.valueOf(value), valueView.getText().toString()); mNumericOptionItem.setValue(null); assertEquals(getApplicationContext().getString(R.string.msdkui_undefined), valueView.getText().toString()); mNumericOptionItem.setValue(0.0f / 0.0f); assertEquals(getApplicationContext().getString(R.string.msdkui_undefined), valueView.getText().toString()); }