Java: Create a Map With Predefined Keys

This article walks you through the lean ways of creating a Map with a fixed (predefined) set of keys.

Option One: Using Lombok and Jackson

In this approach, we would create a simple class. This class would have a set of predefined fields. Once the object of this class is created, we can then use Jackson to create a map from this object.