@SuppressWarnings("serial")
@Test
public void testDecodeRawSets() throws Exception {

    byte[] dataSet = IpfixUtilities.hexStringToByteArray("010300200000006F6161000000DE00000000014D6262000001BC0503000318A3");
    byte[] dataTemplateRecord = IpfixUtilities.hexStringToByteArray("01030004008D000400290002802A000400000E918286FFFF00000E91");
    IpfixDataSet set = new IpfixDataSet(dataSet);
    AbstractTemplateRecord blueprint = new IpfixTemplateRecord(dataTemplateRecord);
    when(m_templateProvider.get(259)).thenReturn(blueprint);
    String hostName = "hostname";
    String family = "standard-dpu";
    when(m_deviceFamilyCacheService.getDeviceFamily(hostName)).thenReturn(family);
    InformationElement ie32 = mock(InformationElement.class);
    InformationElement ieString = mock(InformationElement.class);
    InformationElement ieUnion = mock(InformationElement.class);
    when(m_informationElementService.getInformationElement(family, 141)).thenReturn(null);
    when(m_informationElementService.getInformationElement(family, 41)).thenReturn(ieString);
    when(m_informationElementService.getInformationElement(family, 42)).thenReturn(ie32);
    when(m_informationElementService.getInformationElement(family, 646)).thenReturn(ieUnion);
    when(ieString.getName()).thenReturn("keyForString");
    when(ie32.getName()).thenReturn("keyForUnsigned32");
    when(ieUnion.getName()).thenReturn("keyForUnion");
    when(ie32.getDataType()).thenReturn(InformationElementType.UNSIGNED32);
    when(ieString.getDataType()).thenReturn(InformationElementType.STRING);
    when(ieUnion.getDataType()).thenReturn(InformationElementType.UNION);
    Set<IpfixDecodedData> decodedDataSet = m_decodingDataRecordService.decodeDataSet(hostName, 1L, set, null, m_templateProvider);
    Set<String> decodedCounterValues = new HashSet<>();
    for (IpfixDecodedData decodedData : decodedDataSet) {
        decodedCounterValues.add(decodedData.getDecodedValue());
    }
    Set<String> expectedRecord = new HashSet<>();
    expectedRecord.add("aa");
    expectedRecord.add("bb");
    expectedRecord.add("0000014D");
    expectedRecord.add("444");
    assertTrue(decodedCounterValues.containsAll(expectedRecord));
}