### Question:
DataTypeInfoUtilities { public static synchronized void copyDataTypeInfo(DataTypeInfo toCopy, DefaultDataTypeInfo theCopy, Object source) { boolean isActive = toCopy.getParent().activationProperty().isActive(); if (!isActive) { activate(toCopy); } theCopy.getMetaDataInfo().setGeometryColumn(toCopy.getMetaDataInfo().getGeometryColumn()); theCopy.getMetaDataInfo().setDataTypeInfo(theCopy); for (String colName : toCopy.getMetaDataInfo().getKeyNames()) { if (toCopy.getMetaDataInfo().getSpecialTypeForKey(colName) != null) { theCopy.getMetaDataInfo().setSpecialKey(colName, toCopy.getMetaDataInfo().getSpecialTypeForKey(colName), source); } theCopy.getMetaDataInfo().addKey(colName, toCopy.getMetaDataInfo().getKeyClassType(colName), source); } theCopy.getMapVisualizationInfo().setVisualizationType(toCopy.getMapVisualizationInfo().getVisualizationType()); if (!isActive) { deactivate(toCopy); } } private  DataTypeInfoUtilities(); static synchronized void copyDataTypeInfo(DataTypeInfo toCopy, DefaultDataTypeInfo theCopy, Object source); static synchronized void ensureHasMetadata(DataTypeInfo info);  }### Answer:
@Test public void testCopyDataTypeInfo() throws PropertyChangeException, InterruptedException { EasyMockSupport support = new EasyMockSupport(); DefaultMetaDataInfo mdi = new DefaultMetaDataInfo(); mdi.setGeometryColumn("geom"); mdi.addKey("column1", Integer.class, this); mdi.addKey("geom", String.class, this); mdi.addKey("Lat", Double.class, this); mdi.setSpecialKey("Lat", LatitudeKey.DEFAULT, this); DefaultDataTypeInfo toCopy = new DefaultDataTypeInfo(null, "one", "first", "theFirst", "I am First", false, mdi); DefaultMapFeatureVisualizationInfo visInfo = new DefaultMapFeatureVisualizationInfo(MapVisualizationType.POINT_ELEMENTS); toCopy.setMapVisualizationInfo(visInfo); DefaultDataGroupInfo group = new DefaultDataGroupInfo(false, null, "test", "first"); toCopy.setParent(group); group.activationProperty().setActive(false); ActivationListener listener = createListener(support); group.activationProperty().addListener(listener); DefaultMetaDataInfo copiedMdi = new DefaultMetaDataInfo(); DefaultDataTypeInfo theCopy = new DefaultDataTypeInfo(null, "two", "two", "theFirst", "I am second", false, copiedMdi); DefaultMapFeatureVisualizationInfo theCopyVisInfo = new DefaultMapFeatureVisualizationInfo(MapVisualizationType.UNKNOWN); theCopy.setMapVisualizationInfo(theCopyVisInfo); support.replayAll(); DataTypeInfoUtilities.copyDataTypeInfo(toCopy, theCopy, this); assertNotSame(mdi, theCopy.getMetaDataInfo()); assertEquals("geom", theCopy.getMetaDataInfo().getGeometryColumn()); assertEquals(theCopy, ((DefaultMetaDataInfo)theCopy.getMetaDataInfo()).getDataTypeInfo()); assertEquals(Integer.class, theCopy.getMetaDataInfo().getKeyClassType("column1")); assertEquals(String.class, theCopy.getMetaDataInfo().getKeyClassType("geom")); assertEquals(Double.class, theCopy.getMetaDataInfo().getKeyClassType("Lat")); assertEquals("Lat", theCopy.getMetaDataInfo().getLatitudeKey()); assertEquals(MapVisualizationType.POINT_ELEMENTS, theCopy.getMapVisualizationInfo().getVisualizationType()); support.verifyAll(); }