Gens (Gens newGens) { final List<Value> newValues = newGens.getValues(); final int size = myValues.size(); assert size == newValues.size(); final List<Value> diff = new ArrayList<>(); for (int i = 0; i < size; ++i) { final Value value = myValues.get(i); final Value newValue = newValues.get(i); assert value.name.equals(newValue.name); if (!value.value.equals(newValue.value)) { diff.add(new Value(value.name, value.value + "->" + newValue.value, value.serializer, value.kind)); } } return new Gens(diff); }