### Question:
PrimitiveFieldImpl extends AbstractField { @Override public long getDataLength() { switch (getType()) { case I4: return 4; case I2: return 2; case F8: case DQ8: return 8; default: throw new UnsupportedOperationException( "Unrecognized or invalid fixed-length primitive type: " + getType()); } } PrimitiveFieldImpl(final String fieldName, final DataType dataType); @Override long getDataLength(); @Override String getDeclaration(); @Override int getListSize(); @Override String getName(); @Override Structure getStructure(); @Override DataType getType();  }### Answer:
@Test public void testGetDataLengthDq8() { assertThat(new PrimitiveFieldImpl(FIELD_NAME, DataType.DQ8).getDataLength()).isEqualTo(8); }
@Test public void testGetDataLengthF8() { assertThat(new PrimitiveFieldImpl(FIELD_NAME, DataType.F8).getDataLength()).isEqualTo(8); }
@Test public void testGetDataLengthI2() { assertThat(new PrimitiveFieldImpl(FIELD_NAME, DataType.I2).getDataLength()).isEqualTo(2); }
@Test public void testGetDataLengthI4() { assertThat(new PrimitiveFieldImpl(FIELD_NAME, DataType.I4).getDataLength()).isEqualTo(4); }
@Test(expected = UnsupportedOperationException.class) public void testGetDataLengthVc() { new PrimitiveFieldImpl(FIELD_NAME, DataType.VC).getDataLength(); }