Fix off-by-one issue when removing from Iterator

MapCollections' iterator removes the preceding element
which causes IndexOutOfBoundsExceptions to be thrown
when removing the first element while iterating.

Copied from frameworks/base/core/java/android/util/MapCollections.java

bug:11477476
Change-Id: I3ea1dc5035aa1675336f60e014d9dcc22c4df065
1 file changed