XpTimer

How to implement XPTimer?

public class XpStartGameTimer extends XpGameTimer {

    public XpStartGameTimer(Game game, int minPlayers, int time) {
        super(game, minPlayers, time);
    }

    @Override
    public void onCancel() {
        game.sendMessage("starting cancelled");
        //the method calls when the countdown was stopped
    }

    @Override
    public void onEnd() {
        super.onEnd();
        //the method calls when the countdown was ended
        game.getPlayingUsers().forEach(userGame -> {
            Player player = userGame.toPlayer();

            player.getInventory().clear();
            player.teleport(game.getArena().getLocationByName("spawn"));
        });

        game.setState(new PlayingGameState());
    }
}