public static boolean setValidity(Tickets.Ticket ticket, int validity) {

        if (validity == 1 || validity == 2 || validity == 4 || validity == 6 || validity == 8 || validity == 10) {
            ticket.setValidity(validity);
            return true;
        } else {
            return false;
        }
    }