There are different styles in the codebase, even in a single source file, is it possible and worthy to force same style by ArchUnit?

Nested/Collection/Map configuration property

  1. implicit initialized with null and expose getter and setter
  2. explicit initialized and expose getter and setter
  3. explicit initialized and mark the field as final (no setter)

I vote for option 2, and it is more common in the codebase.

Set/Map configuration property

  1. initialized with HashSet/HashMap
  2. initialized with LinkedHashSet/LinkedHashMap

I think option 2 is meaningless since the Binder will create ordered Set/Map.

Comment From: philwebb

Although not technically public API, we have seen folks use configuration properties outside of the Binder. As such, I think I'd be in favor of option 2 in both cases. That should allow the most flexibility.