croak(java.lang.String message,
int errorCode)
Print an error and exit with the given error code

static boolean

deepEquals(java.lang.Object o1,
java.lang.Object o2)
Determines if two objects are equal as determined by
Object.equals(Object), or "deeply equal" if both are arrays.

static int

deepHashCode(java.lang.Object o)
Gets hash code of an object, optionally returns hash code based on the
"deep contents" of array if the object is an array.

static java.util.List<java.lang.Integer>

distributeEvenlyIntoList(int listLength,
int numElements)
This method returns a list that "evenly" (within one) distributes some
number of elements (peanut butter) over some number of buckets (bread
slices).

static java.util.Map<java.lang.Integer,java.lang.Integer>

distributeEvenlyIntoMap(java.util.Set<java.lang.Integer> mapKeys,
int numElements)
This method returns a map that "evenly" (within one) distributes some
number of elements (peanut butter) over some number of buckets (bread
slices).

static long

elapsedTimeNs(long startNs,
long endNs)
Specifically, this utility is to address the fact that System.nanoTime()
can sometimes go backwards, due to the fact that it relies on the
performance counters

static

<T> java.util.Set<T>

getAddedInTarget(java.util.Set<T> current,
java.util.Set<T> target)
Returns a set of objects that were added to the target list
getAddedInTarget(current, null) - nothing was added, returns null.

static java.util.GregorianCalendar

getCalendarForNextRun(java.util.GregorianCalendar startTime,
int targetDay,
int targetHour)
Given a start time, computes the next time when the wallclock will reach
a certain hour of the day, on a certain day of the week Eg: From today,
when is the next Saturday, 12PM ?

getDeletedInTarget(java.util.Set<T> current,
java.util.Set<T> target)
Returns a set of objects that were deleted in the target set
getDeletedInTarget(current, null) - everything was deleted, returns
current.

static

<T extends java.lang.Enum<T>>
T

getEnumFromString(java.lang.Class<T> c,
java.lang.String string)
A common method for all enums since they can't have another base class

deepEquals

Determines if two objects are equal as determined by
Object.equals(Object), or "deeply equal" if both are arrays.

If both objects are null, true is returned; if both objects are array,
the corresponding Arrays.deepEquals(Object[], Object[]), or
Arrays.equals(int[], int[]) or the like are called to determine
equality.

Note that this method does not "deeply" compare the fields of the
objects.

removeItemsToSplitListEvenly

This method breaks the inputList into distinct lists that are no longer
than maxContiguous in length. It does so by removing elements from the
inputList. This method removes the minimum necessary items to achieve the
goal. This method chooses items to remove that minimize the length of the
maximum remaining run. E.g. given an inputList of 20 elements and
maxContiguous=8, this method will return the 2 elements that break the
inputList into 3 runs of 6 items. (As opposed to 2 elements that break
the inputList into two runs of eight items and one run of two items.)

Parameters:

inputList - The list to be broken into separate runs.

maxContiguous - The upper limit on sub-list size

Returns:

A list of Integers to be removed from inputList to achieve the
maxContiguous goal.