Unity 5 AddClip not works

Just installed Unity 5 and found that AddClip function on Animation component not add any animations.
Here is example:
Animation Anim = transform.GetComponent<Animation>(); Anim.AddClip (new AnimationClip(), "Loco");

Unity 5 creates animations in non-legacy state as default.
Use this construction:

AnimationClip clip = new AnimationClip();


Animation Anim = transform.GetComponent();

Anim.AddClip (clip, “Loco”);