use entrySet instead of Keyset to improve performance.

Issue: SPR-12356
use entrySet instead of Keyset to improve performance.

Issue: SPR-12356