JNumberField extends JSpinner { @Override public Double getValue() { return Double.parseDouble(super.getValue().toString()); } JNumberField();  JNumberField(double defaultNumber, double minValue, double maxValue, double increment); @Override void setValue(Object value); @Override Double getValue(); void setColor(Color color);  }
@Test public void getValueTest() { final JNumberField numberField = new JNumberField(); assertThat(numberField.getValue()).isNotNull(); assertThat(numberField.getValue()).isInstanceOf(Double.class); }
@Test public void defaultValueTest() { final JNumberField numberField = new JNumberField(); assertThat(numberField.getValue()).isEqualTo(0); }
@Test @Parameters({"0.5d"}) public void customDefaultValueTest(double testValue) { final JNumberField numberField = new JNumberField(testValue, 0, Double.MAX_VALUE, 0.1); assertThat(numberField.getValue()).isEqualTo(testValue); }