Add generics to SharedHashMapBuilder