@Test
    public void displayValueCalculation() {
        final TextSpinner<Integer> ts = new TextSpinner<Integer>()
                .setValues(Arrays.asList(1, 2, 3))
                .setDisplayMapper(i -> TextParam.text("I" + i));

        assertThat(convert(ts.getDisplayValues())).isEqualTo(Arrays.asList("I1", "I2", "I3"));
        assertThat(ts.getTextDisplayValue().toString()).isEqualTo("I1");

        //changing display mapper immediately recalculates display values
        ts.setDisplayMapper(i -> TextParam.text("I" + i + "x"));
        assertThat(convert(ts.getDisplayValues())).isEqualTo(Arrays.asList("I1x", "I2x", "I3x"));
        assertThat(ts.getTextDisplayValue().toString()).isEqualTo("I1x");

        //null values are not passed to display mapper
        ts.setValues(Arrays.asList(1, 2, 3, null));
        assertThat(convert(ts.getDisplayValues())).isEqualTo(Arrays.asList("I1x", "I2x", "I3x", "--"));
        assertThat(ts.getTextDisplayValue().toString()).isEqualTo("I1x");

        //setting a text display mapper affects only the textview text
        ts.setTextDisplayMapper(i -> TextParam.text("I" + i + "txt"));
        assertThat(convert(ts.getDisplayValues())).isEqualTo(Arrays.asList("I1x", "I2x", "I3x", "--"));
        assertThat(ts.getTextDisplayValue().toString()).isEqualTo("I1txt");
        //..but null values are not passed to it
        ts.set(null);
        assertThat(ts.getTextDisplayValue().toString()).isEqualTo("--");

    }
This can, of course, only test the non-ui-parts of the {@link TextSpinner}
main/src/test/java/cgeo/geocaching/ui/TextSpinnerTest.java