@Test public void testGetDynamicList() { final Structure varListStructure = mockStructure(); final Field varListField = mock(Field.class); when(varListField.getType()).thenReturn(DataType.DYNAMIC_LIST); when(varListField.getName()).thenReturn("DYNAMIC_LIST"); when(varListField.getStructure()).thenReturn(varListStructure); final DynamicRecordList recordList = mock(DynamicRecordList.class); final Answer<DynamicRecordList> factoryAnswer = new Answer<DynamicRecordList>() { @Override public DynamicRecordList answer(final InvocationOnMock invocation) throws Throwable { return recordList; } }; final DynamicRecordListImplFactory factory = mock(DynamicRecordListImplFactory.class, factoryAnswer); final Structure recordStructure = mockStructure(varListField); final RecordImpl record = new RecordImpl(ROOT_NAME, recordStructure, null, FIXED_LIST_FACTORY, factory, RECORD_FACTORY); assertThat(record.getDynamicList(varListField.getName())).isSameAs(recordList.iterator()); final DynamicRecordList drl = record.getDynamicList(varListField.getName()); assertThat(drl).isSameAs(recordList.iterator()); }
@Override public DynamicRecordList getDynamicList(final String fieldName) { return (DynamicRecordList) getValue(fieldName, DataType.DYNAMIC_LIST); }
RecordImpl implements Record { @Override public DynamicRecordList getDynamicList(final String fieldName) { return (DynamicRecordList) getValue(fieldName, DataType.DYNAMIC_LIST); } }
RecordImpl implements Record { @Override public DynamicRecordList getDynamicList(final String fieldName) { return (DynamicRecordList) getValue(fieldName, DataType.DYNAMIC_LIST); } RecordImpl(final String name, final Structure structure, final Record parent);   RecordImpl(final String name, final Structure structure, final Record parent,
            final RecordListImplFactory fixedListFactory, final DynamicRecordListImplFactory varListFactory,
            final RecordImplFactory recordFactory); }
RecordImpl implements Record { @Override public DynamicRecordList getDynamicList(final String fieldName) { return (DynamicRecordList) getValue(fieldName, DataType.DYNAMIC_LIST); } RecordImpl(final String name, final Structure structure, final Record parent);   RecordImpl(final String name, final Structure structure, final Record parent,
            final RecordListImplFactory fixedListFactory, final DynamicRecordListImplFactory varListFactory,
            final RecordImplFactory recordFactory); @Override String getDeclaration(); @Override DynamicRecordList getDynamicList(final String fieldName); @Override short getI2(final String fieldName); @Override boolean getI2Boolean(final String fieldName); @Override int getI4(final String fieldName); @Override String getChar(final String fieldName); @Override Date getDQ8(final String fieldName); @Override double getF8(final String fieldName); @Override RecordList getList(final String fieldName); @Override String getName(); @Override int getNestedLevel(); @Override Record getRecord(final String fieldName); @Override Structure getStructure(); @Override DataType getType(final String fieldName); @Override String getVC(final String fieldName); @Override boolean hasMember(final String fieldName); @Override boolean isRoot(); @Override void setChar(final String fieldName, final String value); @Override void setDQ8(final String fieldName, final Date value); @Override void setI2(final String fieldName, final short value); @Override void setI2(final String fieldName, final boolean value); @Override void setI4(final String fieldName, final int value); @Override void setF8(final String fieldName, final double value); @Override void setVC(final String fieldName, final String value); @Override String toString(); }
RecordImpl implements Record { @Override public DynamicRecordList getDynamicList(final String fieldName) { return (DynamicRecordList) getValue(fieldName, DataType.DYNAMIC_LIST); } RecordImpl(final String name, final Structure structure, final Record parent);   RecordImpl(final String name, final Structure structure, final Record parent,
            final RecordListImplFactory fixedListFactory, final DynamicRecordListImplFactory varListFactory,
            final RecordImplFactory recordFactory); @Override String getDeclaration(); @Override DynamicRecordList getDynamicList(final String fieldName); @Override short getI2(final String fieldName); @Override boolean getI2Boolean(final String fieldName); @Override int getI4(final String fieldName); @Override String getChar(final String fieldName); @Override Date getDQ8(final String fieldName); @Override double getF8(final String fieldName); @Override RecordList getList(final String fieldName); @Override String getName(); @Override int getNestedLevel(); @Override Record getRecord(final String fieldName); @Override Structure getStructure(); @Override DataType getType(final String fieldName); @Override String getVC(final String fieldName); @Override boolean hasMember(final String fieldName); @Override boolean isRoot(); @Override void setChar(final String fieldName, final String value); @Override void setDQ8(final String fieldName, final Date value); @Override void setI2(final String fieldName, final short value); @Override void setI2(final String fieldName, final boolean value); @Override void setI4(final String fieldName, final int value); @Override void setF8(final String fieldName, final double value); @Override void setVC(final String fieldName, final String value); @Override String toString();  }