MetaType[] itemTypes = { keyType, valueType };
String entryName = Map.Entry.class.getName();
CompositeMetaType entryType = new ImmutableCompositeMetaType(entryName, entryName, DefaultMetaTypeFactory.MAP_ITEM_NAMES, DefaultMetaTypeFactory.MAP_ITEM_NAMES, itemTypes);
TableMetaType tableType = new ImmutableTableMetaType(Map.class.getName(), Map.class.getName(), entryType, DefaultMetaTypeFactory.MAP_INDEX_NAMES);
TableValue expected = new TableValueSupport(tableType);
String[] itemNames = DefaultMetaTypeFactory.MAP_ITEM_NAMES;
MutableCompositeMetaType compositeType = new MutableCompositeMetaType(TestSimpleComposite.class.getName(), TestSimpleComposite.class.getName());
compositeType.addItem("something", "something", SimpleMetaType.STRING);
compositeType.freeze();
String[] compositeNames = { "something" };
CompositeValue compositeValue = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Hello") });
MetaValue[] keyValues1 = {SimpleValueSupport.wrap("Hello")};
CompositeValueSupport key1 = new CompositeValueSupport(keyType, new String[]{"key"}, keyValues1);
MetaValue[] itemValues = new MetaValue[] { key1, compositeValue };
expected.put(new CompositeValueSupport(entryType, itemNames, itemValues));
MetaValue[] keyValues2 = {SimpleValueSupport.wrap("Goodbye")};
CompositeValueSupport key2 = new CompositeValueSupport(keyType, new String[]{"key"}, keyValues2);
compositeValue = new CompositeValueSupport(compositeType, compositeNames, new MetaValue[] { SimpleValueSupport.wrap("Goodbye") });
itemValues = new MetaValue[] { key2, compositeValue };
expected.put(new CompositeValueSupport(entryType, itemNames, itemValues));
MetaValue result = createMetaValue(map, collectionType);
TableValue actual = assertInstanceOf(result, TableValue.class);
getLog().debug("Map Value: " + actual);
assertEquals(expected, actual);
}