Nit: Should return a Map instead of a HashMap. Callers don't need to know the implementation.