### Question:
DecodeUnsigned32 implements IpfixDataRecordDecodeMethod { @Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned32 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Long.toString((IpfixUtilities.bytesToLong(data, 1, LENGTH))); }  @Override String decodeDataRecord(byte[] data, int length);  }### Answer:
@Test public void testDecodeUnsigned32() throws UtilityException, DataTypeLengthMismatchException, UnknownHostException, MissingAbstractDataTypeException { byte[] data = IpfixUtilities.hexStringToByteArray("0000006F"); int length = 4; IpfixDataRecordDecodeMethod method = new DecodeUnsigned32(); String value = method.decodeDataRecord(data, length); assertEquals("111", value); }
@Test(expected = DataTypeLengthMismatchException.class) public void testDecodeUnsigned32LengthMismatch() throws UtilityException, DataTypeLengthMismatchException, UnknownHostException, MissingAbstractDataTypeException { byte[] data = IpfixUtilities.hexStringToByteArray("0000006F"); int length = 5; IpfixDataRecordDecodeMethod method = new DecodeUnsigned32(); String value = method.decodeDataRecord(data, length); assertEquals("111", value); }