### Question:
ImportOp extends AbstractGeoGigOp<RevTree> { private Feature alter(NodeRef node, RevFeatureType featureType) { RevFeature oldFeature = command(RevObjectParse.class).setObjectId(node.getObjectId()) .call(RevFeature.class).get(); RevFeatureType oldFeatureType; oldFeatureType = command(RevObjectParse.class).setObjectId(node.getMetadataId()) .call(RevFeatureType.class).get(); List<PropertyDescriptor> oldAttributes = oldFeatureType.descriptors(); List<PropertyDescriptor> newAttributes = featureType.descriptors(); RevFeatureBuilder builder = RevFeature.builder(); for (int i = 0; i < newAttributes.size(); i++) { int idx = oldAttributes.indexOf(newAttributes.get(i)); if (idx != -1) { Optional<Object> oldValue = oldFeature.get(idx); builder.addValue(oldValue.orElse(null)); } else { builder.addValue(null); } } RevFeature newFeature = builder.build(); FeatureBuilder featureBuilder = new FeatureBuilder(featureType); Feature feature = featureBuilder.build(node.name(), newFeature); return feature; }  ImportOp setAll(boolean all); ImportOp setTable(String table); ImportOp setOverwrite(boolean overwrite); ImportOp setCreateSchemaOnly(boolean createSchema); ImportOp setFidAttribute(String attribute); ImportOp setAlter(boolean alter); ImportOp setDestinationPath(@Nullable String destPath); ImportOp setDataStore(DataStore dataStore); ImportOp setForwardingFeatureIteratorProvider(
            ForwardingFeatureIteratorProvider provider); ImportOp setGeometryNameOverride(String geomName); ImportOp setUsePaging(boolean usePaging); ImportOp setAdaptToDefaultFeatureType(boolean adaptToDefaultFeatureType); ImportOp setFilter(@NonNull Filter filter);  }### Answer:
@Test public void testAlter() throws Exception { ImportOp importOp = repo.command(ImportOp.class); importOp.setDataStore( TestHelper.createTestFactory().createDataStore(Collections.emptyMap())); importOp.setTable("table1"); importOp.call(); importOp.setTable("table2"); importOp.setDestinationPath("table1"); importOp.setAlter(true); importOp.call(); Iterator<NodeRef> features = repo.command(LsTreeOp.class) .setStrategy(Strategy.DEPTHFIRST_ONLY_FEATURES).call(); ArrayList<NodeRef> list = Lists.newArrayList(features); assertEquals(3, list.size()); Optional<RevFeature> feature = repo.command(RevObjectParse.class) .setRefSpec("WORK_HEAD:table1/feature1").call(RevFeature.class); assertTrue(feature.isPresent()); List<Optional<Object>> values = feature.get().getValues(); assertEquals(2, values.size()); assertTrue(values.get(0).isPresent()); assertFalse(values.get(1).isPresent()); TreeSet<ObjectId> set = Sets.newTreeSet(); for (NodeRef node : list) { set.add(node.getMetadataId()); } assertEquals(1, set.size()); Optional<RevFeatureType> featureType = repo.command(RevObjectParse.class) .setObjectId(set.iterator().next()).call(RevFeatureType.class); assertTrue(featureType.isPresent()); assertEquals("table1", featureType.get().getName().getLocalPart()); assertEquals("name", featureType.get().descriptors().get(1).getName().getLocalPart()); }