public virtual void Normalize([NotNull] FeedUri feedUri)
{
#region Sanity checks
if (feedUri == null) throw new ArgumentNullException(nameof(feedUri));
#endregion
// Apply if-0install-version filter
Commands.RemoveAll(FilterMismatch);
Dependencies.RemoveAll(FilterMismatch);
Restrictions.RemoveAll(FilterMismatch);
Bindings.RemoveAll(FilterMismatch);
// Convert legacy launch commands
if (Main != null) Commands.Add(new Command {Name = Command.NameRun, Path = Main});
if (SelfTest != null) Commands.Add(new Command {Name = Command.NameTest, Path = SelfTest});
foreach (var command in Commands) command.Normalize();
foreach (var dependency in Dependencies) dependency.Normalize();
foreach (var restriction in Restrictions) restriction.Normalize();
}