PMath { public static ScriptedSchedule buildScriptedSchedule(long[] schedulePeriods) { return buildScriptedSchedule(schedulePeriods, false); }  static void factors(long value, byte[] target, int offset, int length, int mask); static void greatestCommonFactor( byte[] backingA, int offsetA, int lengthA, int maskA,
                                             byte[] backingB, int offsetB, int lengthB, int maskB,
                                             byte[] target,   int offset, int length, int mask); static void greatestCommonFactor( byte[][] backingA, int[] offsetA, int[] lengthA, int[] maskA,
                                             byte[] target, int offset, int length, int mask); static void removeFactors( byte[] backingA, int offsetA, int lengthA, int maskA,
                                     byte[] backingB, int offsetB, int lengthB, int maskB,
                                     byte[] target,   int offset, int length, int mask); static void removeExistingFactors( byte[] backingA, int offsetA, int lengthA, int maskA,
                                             byte[] backingB, int offsetB, int lengthB, int maskB,
                                             byte[] target,   int offset, int length, int mask); static void addFactors( byte[] backingA, int offsetA, int lengthA, int maskA,
                                  byte[] backingB, int offsetB, int lengthB, int maskB,
                                  byte[] target,   int offset, int length, int mask); static int factorsToInt(byte[] target, int offset, int length, int mask); static long factorsToLong(byte[] target, int offset, int length, int mask); static int nextPrime(int startValue); static ScriptedSchedule buildScriptedSchedule(long[] schedulePeriods); static ScriptedSchedule buildScriptedSchedule(long[] schedulePeriods, final boolean reverseOrder);  }
@Test public void testScheduler() { long[] schedulePeriods = {300, 70, 50 ,20}; ScriptedSchedule schedule = PMath.buildScriptedSchedule(schedulePeriods); assertEquals(394, schedule.script.length); assertEquals(10, schedule.commonClock); assertEquals(3, schedule.maxRun); }