protected static int DetermineConstantInsertPosition(
            SyntaxList<MemberDeclarationSyntax> oldMembers,
            SyntaxList<MemberDeclarationSyntax> newMembers)
        {
            // 1) Place the constant after the last constant.
            //
            // 2) If there is no constant, place it before the first field
            //
            // 3) If the first change is before either of those, then place before the first
            // change
            //
            // 4) Otherwise, place it at the start.
            var index = 0;
            var lastConstantIndex = oldMembers.LastIndexOf(IsConstantField);

            if (lastConstantIndex >= 0)
            {
                index = lastConstantIndex + 1;
            }
            else
            {
                var firstFieldIndex = oldMembers.IndexOf(member => member is FieldDeclarationSyntax);
                if (firstFieldIndex >= 0)
                {
                    index = firstFieldIndex;
                }
            }

            var firstChangeIndex = DetermineFirstChange(oldMembers, newMembers);
            if (firstChangeIndex >= 0)
            {
                index = Math.Min(index, firstChangeIndex);
            }

            return index;
        }