How can I compare the items in two lists and create a new list with the difference in Groovy?
If it is a list of numbers, you can do this:
def before = [0, 0, 1, 0] def after = [0, 1, 1, 0] def difference =[] for (def i=0; i<4; i++){ difference<