### Question:
German6aus49Ticket extends MainTicket<German6aus49Field, German6aus49Lottery, German6aus49Drawing> { @Override public boolean adjust() { final German6aus49Lottery lottery = getLottery(); final DrawingType drawingType = fromType(getDrawingType()); ZonedDateTime currentDateTime = ZonedDateTime.now(ZoneId.of("Europe/Paris")); if (getState() == TicketState.INITIAL) { if (currentDateTime.isAfter(getStartingDate())) { setStartingDate(lottery.getNextDrawing(currentDateTime, drawingType)); calculateAndSetEndingDate(); return true; } } return false; } 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 testAdjust() { 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("german6aus49we"); ticket.setPermaTicket(true); ticket.setDurationOrBillingPeriod(1); ticket.setNumber(new Integer[]{1,2,3,4,5,6,7}); final German6aus49Ticket german6aus49Ticket = Mockito.spy(ticket); PriceList priceList = getCurrentPriceList(); German6aus49Lottery lottery = new German6aus49Lottery(); final German6aus49Lottery spyLottery = Mockito.spy(lottery); Mockito.when(spyLottery.getDateTimeService()).thenReturn(new DateTimeService()); Mockito.doReturn(spyLottery).when(german6aus49Ticket).getLottery(); Mockito.doReturn(priceList).when(german6aus49Ticket).getCurrentPriceList(null); german6aus49Ticket.initTicket(); german6aus49Ticket.setStartingDate(spyLottery.getDateTimeNow().minusDays(1)); german6aus49Ticket.adjust(); ZonedDateTime expected = spyLottery.getNextDrawing(null, DrawingType.GERMAN6AUS49WE); assertThat(german6aus49Ticket.getStartingDate(), is(expected)); }