### Question:
StructureDB extends CompositeDB implements Structure { @Override public void clearComponent(int ordinal) { lock.acquire(); try { checkDeleted(); if (ordinal < 0 || ordinal >= numComponents) { throw new ArrayIndexOutOfBoundsException(ordinal); } int idx; if (isInternallyAligned()) { idx = ordinal; } else { idx = Collections.binarySearch(components, Integer.valueOf(ordinal), ordinalComparator); } if (idx >= 0) { DataTypeComponentDB dtc = components.remove(idx); dtc.getDataType().removeParent(this); try { componentAdapter.removeRecord(dtc.getKey()); } catch (IOException e) { dataMgr.dbError(e); } int len = dtc.getLength(); if (len > 1) { shiftOffsets(idx, len - 1, 0); } adjustInternalAlignment(true); dataMgr.dataTypeChanged(this); } } finally { lock.release(); } } StructureDB(DataTypeManagerDB dataMgr, DBObjectCache<DataTypeDB> cache,
			CompositeDBAdapter compositeAdapter, ComponentDBAdapter componentAdapter,
			Record record); @Override String getRepresentation(MemBuffer buf, Settings settings, int length); @Override DataTypeComponent add(DataType dataType, int length, String name, String comment); @Override void growStructure(int amount); @Override DataTypeComponent insert(int ordinal, DataType dataType, int length, String name,
			String comment); @Override DataTypeComponent addBitField(DataType baseDataType, int bitSize, String componentName,
			String comment); @Override DataTypeComponent insertBitField(int ordinal, int byteWidth, int bitOffset,
			DataType baseDataType, int bitSize, String componentName, String comment); @Override DataTypeComponent insertBitFieldAt(int byteOffset, int byteWidth, int bitOffset,
			DataType baseDataType, int bitSize, String componentName, String comment); @Override void delete(int ordinal); @Override void delete(int[] ordinals); @Override boolean isPartOf(DataType dataType); @Override int getNumComponents(); @Override int getNumDefinedComponents(); @Override DataTypeComponent getComponent(int ordinal); @Override DataTypeComponent[] getComponents(); @Override DataType copy(DataTypeManager dtm); @Override Structure clone(DataTypeManager dtm); @Override boolean isNotYetDefined(); @Override int getAlignment(); @Override int getLength(); @Override void clearComponent(int ordinal); @Override void deleteAtOffset(int offset); @Override DataTypeComponent getComponentAt(int offset); @Override DataTypeComponent getDataTypeAt(int offset); @Override DataTypeComponentDB[] getDefinedComponents(); @Override final DataTypeComponent insertAtOffset(int offset, DataType dataType, int length); @Override DataTypeComponent insertAtOffset(int offset, DataType dataType, int length, String name,
			String comment); @Override DataTypeComponent replace(int ordinal, DataType dataType, int length, String name,
			String comment); @Override final DataTypeComponent replace(int ordinal, DataType dataType, int length); @Override DataTypeComponent replaceAtOffset(int offset, DataType dataType, int length, String name,
			String comment); @Override void replaceWith(DataType dataType); @Override void dataTypeDeleted(DataType dt); @Override void dataTypeSizeChanged(DataType dt); @Override void dataTypeAlignmentChanged(DataType dt); @Override boolean isEquivalent(DataType dataType); @Override String getDefaultLabelPrefix(); @Override void dataTypeReplaced(DataType oldDt, DataType newDt); @Override void dataTypeNameChanged(DataType dt, String oldName); @Override void deleteAll(); @Override void realign(); @Override void pack(int packingSize); @Override boolean hasFlexibleArrayComponent(); @Override DataTypeComponentDB getFlexibleArrayComponent(); @Override DataTypeComponent setFlexibleArrayComponent(DataType flexType, String name,
			String comment); @Override void clearFlexibleArrayComponent();  }### Answer:
@Test public void testClearComponent() { struct.clearComponent(0); assertEquals(8, struct.getLength()); assertEquals(4, struct.getNumComponents()); DataTypeComponent dtc = struct.getComponent(0); assertEquals(DataType.DEFAULT, dtc.getDataType()); dtc = struct.getComponent(1); assertEquals(WordDataType.class, dtc.getDataType().getClass()); }