@SuppressWarnings({"unchecked"})
public <T> T merge(final T modified, final T base, final T head)
{
final DiffNode.Visitor visitor = new MergingDifferenceVisitor<T>(head, modified);
final DiffNode difference = objectDiffer.compare(modified, base);
difference.visit(visitor);
return head;
}
private static final class MergingDifferenceVisitor<T> implements DiffNode.Visitor
{