Java implementation of a simple rule engine to apply rules over a series of integers