Initialize Map of EnumMap
<p>I need to initialize the following private member in a JavaFX application where I am trying to organize gui widgets, however I do not know the correct syntax, could someone please let me know the correct syntax:</p>

<p>Here is the enum I am using for my EnumMap</p>

<pre><code>enum Connection {
    Connection1,
    Connection2,
    Connection3,
    Connection4;
}
</code></pre>

<p>Here are a selection of the widgets that I am trying to organize with this map or <strong>EnumMaps</strong> based on a service name key, so the following list of 4 checkboxes and labels belong together, (I have similar JavaFX widgets for service 2 and so forth.</p>

<pre><code>@FXML
private CheckBox mService1CheckBox1;
@FXML
private CheckBox mService1CheckBox2;
@FXML
private CheckBox mService1CheckBox3;
@FXML
private CheckBox mService1CheckBox4;
@FXML
private Label mService1Label1;
@FXML
private Label mService1Label1;
@FXML
private Label mService1Label1;
@FXML
private Label mService1Label1;
</code></pre>

<p>This is the private Member I am trying to initialize with JavaFX widgets</p>

<pre><code>private Map&lt;String, EnumMap&lt;Connection, AbstractMap.SimpleEntry&lt;Label,
CheckBox&gt;&gt;&gt; mWidgetInfo;
</code></pre>

<p>I can initialize the top level empty mServiceWidgetMap with:</p>

<pre><code>mWidgetInfo= new HashMap&lt;&gt;();
</code></pre>

<p>And I know that I need to initialize the EnumMaps as new EnumMap&lt;>(Connection.class); but I also need to put pairs of widgets in the value size of these EnumMaps and I am confused as to how to do this.</p>

<p>However I don't know how to initialize the enumMap value pairs.  Syntax help much appreciated.</p>

<p><strong>EDIT</strong>
After struggling for a while I came up with the following, but surely there has got to be a simpler approach like double brace initialization or some other less verbose approach.</p>

<pre><code>private void initializeServiceHeartbeatTab() {
    // @JC Todo - dynamically create base on CSV rows
    // Map&lt;String, EnumMap&lt;Connection, SimpleEntry&lt;Label, CheckBox&gt;&gt;&gt;
    EnumMap&lt;Connection, SimpleEntry&lt;Label, CheckBox&gt;&gt; service1Info =
        new EnumMap&lt;&gt;(Connection.class);
    SimpleEntry&lt;Label, CheckBox&gt; pair1 = new SimpleEntry&lt;&gt;(
        mService1Label1, mService1CheckBox1);
    SimpleEntry&lt;Label, CheckBox&gt; pair2 = new SimpleEntry&lt;&gt;(
        mService1Label2, mService1CheckBox2);
    SimpleEntry&lt;Label, CheckBox&gt; pair3 = new SimpleEntry&lt;&gt;(
        mService1Label3, mService1CheckBox3);
    SimpleEntry&lt;Label, CheckBox&gt; pair4 = new SimpleEntry&lt;&gt;(
        mService1Label4, mService1CheckBox4);
    service1Info.put(Connection.Connection1, pair1);
    service1Info.put(Connection.Connection1, pair2);
    service1Info.put(Connection.Connection1, pair3);
    service1Info.put(Connection.Connection1, pair4);

    EnumMap&lt;Connection, SimpleEntry&lt;Label, CheckBox&gt;&gt; service2Info = 
        new EnumMap&lt;&gt;(Connection.class);
    pair1 = new SimpleEntry&lt;&gt;(mService2Label1, mService2CheckBox1);
    pair2 = new SimpleEntry&lt;&gt;(mService2Label2, mService2CheckBox2);
    pair3 = new SimpleEntry&lt;&gt;(mService2Label3, mService2CheckBox3);
    pair4 = new SimpleEntry&lt;&gt;(mService2Label4, mService2CheckBox4);
    service2Info.put(Connection.Connection1, pair1);
    service2Info.put(Connection.Connection1, pair2);
    service2Info.put(Connection.Connection1, pair3);
    service2Info.put(Connection.Connection1, pair4);

    EnumMap&lt;Connection, SimpleEntry&lt;Label, CheckBox&gt;&gt; service2Info = 
        new EnumMap&lt;&gt;(Connection.class);
    pair1 = new SimpleEntry&lt;&gt;(mService3Label1, mService3CheckBox1);
    pair2 = new SimpleEntry&lt;&gt;(mService3Label2, mService3CheckBox2);
    pair3 = new SimpleEntry&lt;&gt;(mService3Label3, mService3CheckBox3);
    pair4 = new SimpleEntry&lt;&gt;(mService3Label4, mService3CheckBox4);
    service3Info.put(Connection.Connection1, pair1);
    service3Info.put(Connection.Connection1, pair2);
    service3Info.put(Connection.Connection1, pair3);
    service3Info.put(Connection.Connection1, pair4);

    mWidgetInfo = new HashMap&lt;&gt;();
    mWidgetInfo.put("albf", service1Info);
    mWidgetInfo.put("fms1", service2Info);
    mWidgetInfo.put("fms2", service3Info);
}
</code></pre>