### Question:
DBaseFileReader implements Iterable<AttributeProvider>, AutoCloseable { @Pure public List<DBaseFileField> getDBFFields() { try { return readDBFFields(); } catch (IOException e) { return null; } } @SuppressWarnings("resource")  DBaseFileReader(InputStream inputStream); @SuppressWarnings("resource")  DBaseFileReader(File file);  DBaseFileReader(URL url);  DBaseFileReader(ReadableByteChannel channel); @SuppressWarnings({"checkstyle:regexp", "checkstyle:magicnumber"}) static void main(String[] args); @Pure boolean hasOption(int option); void addOption(int option); void removeOption(int option); void setOption(int option, boolean option_is_set); @Override void close(); @Pure boolean isClosed(); @Pure int getDBFRecordCount(); @Pure int getDBFRecordSize(); @Pure @SuppressWarnings("checkstyle:magicnumber") int getDBFHeaderSize(); @Pure int getDBFFieldCount(); @Pure Date getDBFLastUpdateDate(); @Pure DBaseCodePage getDBFLanguage(); @Pure int getDBFVersion(); @SuppressWarnings("checkstyle:magicnumber") void readDBFHeader(); @Pure List<DBaseFileField> getDBFFields(); @Pure String getDBFFieldName(int index); @Pure int getDBFFieldIndex(String name); @Pure DBaseFieldType getDBFFieldType(int index); @SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:magicnumber"}) List<DBaseFileField> readDBFFields(); DBaseFileRecord readNextDBFRecord(); void skip(int skipAmount); void seek(int recordIndex); AttributeProvider readNextAttributeProvider(); List<DBaseFileRecord> readRestOfDBFRecords(); void selectColumn(DBaseFileField column); void selectAllColumns(); @Pure boolean isColumnSelectable(DBaseFileField column); @Override @Pure Iterator<AttributeProvider> iterator(); static final int OPTION_DECODE_STRING; }### Answer:
@Test public void testGetDBFFields() throws Exception { assertNull(this.reader.getDBFFields()); this.reader.readDBFHeader(); List<DBaseFileField> fields = this.reader.getDBFFields(); assertNotNull(fields); assertEquals(4, fields.size()); assertEquals("SOURCE", fields.get(0).getName()); assertEquals("CATEGORIE", fields.get(1).getName()); assertEquals("NATURE", fields.get(2).getName()); assertEquals("HAUTEUR", fields.get(3).getName()); }