I think you should be able to use ImmutableMap.Builder.