// Path: src/main/java/org/dmfs/rfc5545/recur/RecurrenceRule.java
// public enum RfcMode
// {
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a>. Every error will cause an exception to
//      * be thrown.
//      */
//     RFC2445_STRICT,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a> in a more tolerant way. The parser will
//      * just skip invalid parts in the rule and won't complain as long as the result is a valid rule. <p> This mode also accepts rules that comply with <a
//      * href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a>. </p> <p> <strong>Note:</strong> Using this mode rules are evaluated
//      * differently than with {@link #RFC5545_LAX}. {@link #RFC5545_LAX} will just drop all invalid parts and evaluate the rule according to RFC 5545. This
//      * mode will evaluate all rules. <p> Also this mode will output rules that comply with RFC 2445. </p>
//      */
//     RFC2445_LAX,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a>. Every error will cause an exception to
//      * be thrown.
//      */
//     RFC5545_STRICT,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a> in a more tolerant way. The parser will
//      * just skip invalid parts in the rule and won't complain as long as the result is a valid rule. <p> This mode also accepts rules that comply with <a
//      * href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a> but not with RFC 5545. </p> <p> <strong>Note:</strong> Using this mode rules
//      * are evaluated differently than with {@link #RFC2445_LAX}. This mode will just drop all invalid parts and evaluate the rule according to RFC 5545.
//      * {@link #RFC2445_LAX} will evaluate all rules. <p> Also this mode will output rules that comply with RFC 5545. </p>
//      */
//     RFC5545_LAX;
// }
// 
// Path: src/main/java/org/dmfs/rfc5545/recur/RecurrenceRule.java
// public enum Skip
// {
//     /**
//      * OMIT is the default value. It means that non-existing dates are just ignored.
//      */
//     OMIT,
// 
//     /**
//      * BACKWARD means that non-existing instanced get rolled back to the previous day (for leap days) or month (for leap months).
//      */
//     BACKWARD,
// 
//     /**
//      * FORWARD means that non-existing instanced get rolled forward to the next day (for leap days) or month (for leap months).
//      */
//     FORWARD;
// }


import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.dmfs.rfc5545.DateTime;
import org.dmfs.rfc5545.recur.RecurrenceRule.RfcMode;
import org.dmfs.rfc5545.recur.RecurrenceRule.Skip;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
            RecurrenceRule r = new RecurrenceRule(rule.rule, rule.mode);
            DateTime start = null;
            if (rule.start != null)
            {
                start = rule.start;
            }
            else if (!rule.floating)
            {
                start = ABSOLUTE_TEST_START_DATE;
            }
            else if (!rule.allday)
            {
                start = FLOATING_TEST_START_DATE;
            }
            else
            {
                start = ALLDAY_TEST_START_DATE;
            }

            // no instance should be before this day
            DateTime lastInstance = new DateTime(DateTime.UTC, 1900, 0, 1, 0, 0, 0);

            int count = 0;
            RecurrenceRuleIterator it = r.iterator(start);
            while (it.hasNext())
            {
                DateTime instance = it.nextDateTime();
                // check that the previous instance is always before the next instance
                String errMsg = "";
                errMsg = "instance no " + count + " " + lastInstance + " not before " + instance + " in rule "
// Path: src/main/java/org/dmfs/rfc5545/recur/RecurrenceRule.java
// public enum RfcMode
// {
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a>. Every error will cause an exception to
//      * be thrown.
//      */
//     RFC2445_STRICT,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a> in a more tolerant way. The parser will
//      * just skip invalid parts in the rule and won't complain as long as the result is a valid rule. <p> This mode also accepts rules that comply with <a
//      * href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a>. </p> <p> <strong>Note:</strong> Using this mode rules are evaluated
//      * differently than with {@link #RFC5545_LAX}. {@link #RFC5545_LAX} will just drop all invalid parts and evaluate the rule according to RFC 5545. This
//      * mode will evaluate all rules. <p> Also this mode will output rules that comply with RFC 2445. </p>
//      */
//     RFC2445_LAX,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a>. Every error will cause an exception to
//      * be thrown.
//      */
//     RFC5545_STRICT,
// 
//     /**
//      * Parses recurrence rules according to <a href="http://tools.ietf.org/html/rfc5545#section-3.3.10">RFC 5545</a> in a more tolerant way. The parser will
//      * just skip invalid parts in the rule and won't complain as long as the result is a valid rule. <p> This mode also accepts rules that comply with <a
//      * href="http://tools.ietf.org/html/rfc2445#section-4.3.10">RFC 2445</a> but not with RFC 5545. </p> <p> <strong>Note:</strong> Using this mode rules
//      * are evaluated differently than with {@link #RFC2445_LAX}. This mode will just drop all invalid parts and evaluate the rule according to RFC 5545.
//      * {@link #RFC2445_LAX} will evaluate all rules. <p> Also this mode will output rules that comply with RFC 5545. </p>
//      */
//     RFC5545_LAX;
// }
// 
// Path: src/main/java/org/dmfs/rfc5545/recur/RecurrenceRule.java
// public enum Skip
// {
//     /**
//      * OMIT is the default value. It means that non-existing dates are just ignored.
//      */
//     OMIT,
// 
//     /**
//      * BACKWARD means that non-existing instanced get rolled back to the previous day (for leap days) or month (for leap months).
//      */
//     BACKWARD,
// 
//     /**
//      * FORWARD means that non-existing instanced get rolled forward to the next day (for leap days) or month (for leap months).
//      */
//     FORWARD;
// }


// Path: src/test/java/org/dmfs/rfc5545/recur/RecurrenceIteratorTest.java
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.dmfs.rfc5545.DateTime;
import org.dmfs.rfc5545.recur.RecurrenceRule.RfcMode;
import org.dmfs.rfc5545.recur.RecurrenceRule.Skip;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

            RecurrenceRule r = new RecurrenceRule(rule.rule, rule.mode);
            DateTime start = null;
            if (rule.start != null)
            {
                start = rule.start;
            }
            else if (!rule.floating)
            {
                start = ABSOLUTE_TEST_START_DATE;
            }
            else if (!rule.allday)
            {
                start = FLOATING_TEST_START_DATE;
            }
            else
            {
                start = ALLDAY_TEST_START_DATE;
            }

            // no instance should be before this day
            DateTime lastInstance = new DateTime(DateTime.UTC, 1900, 0, 1, 0, 0, 0);

            int count = 0;
            RecurrenceRuleIterator it = r.iterator(start);
            while (it.hasNext())
            {
                DateTime instance = it.nextDateTime();
                // check that the previous instance is always before the next instance
                String errMsg = "";
                errMsg = "instance no " + count + " " + lastInstance + " not before " + instance + " in rule "
                        + new RecurrenceRule(rule.rule, RfcMode.RFC5545_LAX).toString();