angular/material — pull request #1066 by gkalpak (2014-12-29 10:22:02+00:00)
Title: fix($mdUtil): fix bugs in iterator's `next()`/`previous()` methods and add tests for relooping

The first commit adds tests (mainly for "relooping" functionality), some of which fail because of iterator implementation bugs.
The second commit fixes those bugs (and slightly refactors `next()`/`previous()` for DRY-ness).

Related to ff79c91