This looks wrong. You want to have set `locationFlags` inside the previous if - if statement (i.e. where flags is used). Your code will only warn if the third call to flags is different from the second, I think.

And some minor things for future reference:
* Declare field as just `Map` rather than `ImmutableMap` (because users of the field don't care).
* For future reference, `ImmutableMap.copyOf(flags)` does what you're using the builder for.
* This code is a bit dangerous because if flags contains a null key or null value then it will blow up. We'd prefer it to only complain if the thing trying to use the flags doesn't want null. So I'd just do `Collections.unmodifiableMap(Maps.newLinkedHashMap(flags))`.