### Question:
German6aus49Ticket extends MainTicket<German6aus49Field, German6aus49Lottery, German6aus49Drawing> { @Override public void addField(German6aus49Field field) { this.fields.add(field); } German6aus49Ticket(); @Override void sortFieldNumbers(); @Override void initStartingAndEndingDate(); @Override int getNumberOfDrawings(); @Override int getTicketPriceMultiplicator(); @Override int calculateTicketPrice(PriceList currentPriceList, int multiplicator); @Override int calculateTicketFee(PriceList currentPriceList, int multiplicator); @Override Price getTotalTicketPrice(); @Override void validate(); @Override boolean adjust(); boolean isValidForCurrentDate(ZonedDateTime currentDateTime); @Override boolean canAcceptAdditionalLottery(String additionalLotteryIdentifier); @Override List<CalculatedField> calculateStrokes(German6aus49Drawing drawing); @Override German6aus49Lottery getLottery(); @Override List<German6aus49Field> getFields(); @XmlElement void setFields(List<German6aus49Field> fields); @Override void addField(German6aus49Field field);  }### Answer:
@Test public void testToJson() { German6aus49Ticket ticket = new German6aus49Ticket(); ticket.addField(new German6aus49Field(1, new Integer[]{1,2,3,4,5,6})); ticket.addField(new German6aus49Field(2, new Integer[]{10,11,12,13,14,15})); ticket.setState(TicketState.INITIAL); ticket.setDrawingType("german6aus49wesa"); ticket.setPermaTicket(true); ticket.setDurationOrBillingPeriod(1); ticket.setNumber(new Integer[]{1,2,3,4,5,6,7}); final String expected = "{\"type\":\"german6Aus49Ticket\",\"lotteryIdentifier\":\"german6aus49\",\"embeddedTickets\":{},\"state\":\"INITIAL\",\"drawingType\":\"german6aus49wesa\",\"permaTicket\":true,\"durationOrBillingPeriod\":1,\"number\":[1,2,3,4,5,6,7],\"fields\":[{\"fieldNumber\":1,\"selectedNumbers\":[1,2,3,4,5,6],\"selectedAdditionalNumbers\":[]},{\"fieldNumber\":2,\"selectedNumbers\":[10,11,12,13,14,15],\"selectedAdditionalNumbers\":[]}]}"; assertThat(ticket.toJson(German6aus49Ticket.class), is(expected)); }