Could save a line:
if (!b.containsKey(k)) return false;
if (b[k] != a[k]) return false;