@@ -135,15 +135,15 @@ public void testPooledMemoryChoiceOnNotSmallHeap() throws InterruptedException,
135135 }
136136
137137 public void testMaxDirectMemorySizeChoice () throws InterruptedException , IOException {
138- final Map <String , String > heapMaxDirectMemorySize = Map . of (
139- "64M" , Long .toString ((64L << 20 ) / 2 ),
140- "512M" , Long .toString ((512L << 20 ) / 2 ),
141- "1024M" , Long .toString ((1024L << 20 ) / 2 ),
142- "1G" , Long .toString ((1L << 30 ) / 2 ),
143- "2048M" , Long .toString ((2048L << 20 ) / 2 ),
144- "2G" , Long .toString ((2L << 30 ) / 2 ),
145- "8G" , Long .toString ((8L << 30 ) / 2 ));
146- final String heapSize = randomFrom (heapMaxDirectMemorySize .keySet ().toArray (String []:: new ));
138+ final Map <String , String > heapMaxDirectMemorySize = new HashMap <>();
139+ heapMaxDirectMemorySize . put ( "64M" , Long .toString ((64L << 20 ) / 2 ));
140+ heapMaxDirectMemorySize . put ( "512M" , Long .toString ((512L << 20 ) / 2 ));
141+ heapMaxDirectMemorySize . put ( "1024M" , Long .toString ((1024L << 20 ) / 2 ));
142+ heapMaxDirectMemorySize . put ( "1G" , Long .toString ((1L << 30 ) / 2 ));
143+ heapMaxDirectMemorySize . put ( "2048M" , Long .toString ((2048L << 20 ) / 2 ));
144+ heapMaxDirectMemorySize . put ( "2G" , Long .toString ((2L << 30 ) / 2 ));
145+ heapMaxDirectMemorySize . put ( "8G" , Long .toString ((8L << 30 ) / 2 ));
146+ final String heapSize = randomFrom (heapMaxDirectMemorySize .keySet ().toArray (new String [0 ] ));
147147 assertThat (
148148 JvmErgonomics .choose (Arrays .asList ("-Xms" + heapSize , "-Xmx" + heapSize )),
149149 hasItem ("-XX:MaxDirectMemorySize=" + heapMaxDirectMemorySize .get (heapSize )));
0 commit comments