### Question:
JmsMapMessage extends JmsMessage implements MapMessage { @Override public Enumeration<String> getMapNames() throws JMSException { initializeReading(); return Collections.enumeration(map.keySet()); } JmsMapMessage(JmsMessageFacade facade); @Override JmsMessage copy(); void copy(JmsMapMessage other); @Override void clearBody(); @Override boolean getBoolean(String name); @Override byte getByte(String name); @Override short getShort(String name); @Override char getChar(String name); @Override int getInt(String name); @Override long getLong(String name); @Override float getFloat(String name); @Override double getDouble(String name); @Override String getString(String name); @Override byte[] getBytes(String name); @Override Object getObject(String name); @Override Enumeration<String> getMapNames(); @Override void setBoolean(String name, boolean value); @Override void setByte(String name, byte value); @Override void setShort(String name, short value); @Override void setChar(String name, char value); @Override void setInt(String name, int value); @Override void setLong(String name, long value); @Override void setFloat(String name, float value); @Override void setDouble(String name, double value); @Override void setString(String name, String value); @Override void setBytes(String name, byte[] value); @Override void setBytes(String name, byte[] value, int offset, int length); @Override void setObject(String name, Object value); @Override boolean itemExists(String name); @Override String toString();  }### Answer:
@Test public void testGetMapNames() throws JMSException { JmsMapMessage msg = factory.createMapMessage(); msg.setBoolean("boolean", true); msg.setByte("byte", (byte) 1); msg.setBytes("bytes1", new byte[1]); msg.setBytes("bytes2", new byte[3], 0, 2); msg.setChar("char", 'a'); msg.setDouble("double", 1.5); msg.setFloat("float", 1.5f); msg.setInt("int", 1); msg.setLong("long", 1); msg.setObject("object", "stringObj"); msg.setShort("short", (short) 1); msg.setString("string", "string"); msg = (JmsMapMessage) msg.copy(); Enumeration<String> mapNamesEnum = msg.getMapNames(); List<String> mapNamesList = Collections.list(mapNamesEnum); assertEquals(mapNamesList.size(), 12); assertTrue(mapNamesList.contains("boolean")); assertTrue(mapNamesList.contains("byte")); assertTrue(mapNamesList.contains("bytes1")); assertTrue(mapNamesList.contains("bytes2")); assertTrue(mapNamesList.contains("char")); assertTrue(mapNamesList.contains("double")); assertTrue(mapNamesList.contains("float")); assertTrue(mapNamesList.contains("int")); assertTrue(mapNamesList.contains("long")); assertTrue(mapNamesList.contains("object")); assertTrue(mapNamesList.contains("short")); assertTrue(mapNamesList.contains("string")); }