private SimpleItem makeItem ( @ IntRange ( from = 0 , to = 25 ) int position ) { SimpleItem result = new SimpleItem ( ) ; result . withName ( ALPHABET [ position ] ) ; position ++ ; String description = "The " + ( position ) ; if ( position == 1 || position == 21 ) { description += "st" ; } else if ( position == 2 || position == 22 ) { description += "nd" ; } else if ( position == 3 || position == 23 ) { description += "rd" ; } else { description += "th" ; } return result . withDescription ( description + " letter in the alphabet" ) ; }
Build a simple item with one letter of the alphabet .