### Question:
GtfReader implements AutoCloseable { public Gtf read() throws FileFormatException { final Pattern kvpattern = Pattern.compile("(\\S*)\\s\"(.*)\""); try { String line = ""; while ((line = bufferedReader.readLine()) != null && (line.trim().equals("") || line.startsWith("#"))) { } if (line != null) { String[] fields = line.split("\t"); Map<String, String> attributes = new HashMap<String, String>(); String[] attrFields = fields[8].split(";(?=([^\"]*\"[^\"]*\")*[^\"]*$)"); String k, v; for (int i = 0; i < attrFields.length; i++) { final Matcher matcher = kvpattern.matcher(attrFields[i].trim()); if (matcher.matches()) { k = matcher.group(1); v = matcher.group(2); if(attributes.containsKey(k)) { attributes.put(k, attributes.get(k)+","+v); } else { attributes.put(k, v); } } else if (StringUtils.isNotEmpty(attrFields[i].trim())) { System.err.println("GTF attribute '" + attrFields[i] + "' at index " + i + ": size must be 2. At line:\n\t"+line); } } return new Gtf(fields[0], fields[1], fields[2], Integer.parseInt(fields[3]), Integer.parseInt(fields[4]), fields[5], fields[6], fields[7], attributes); } else { return null; } } catch (Exception e) { throw new FileFormatException(e); } } GtfReader(Reader reader);  GtfReader(Path path); Gtf read(); List<Gtf> read(int numberLines); List<Gtf> readAll(); int size(); void close();  }### Answer:
@Test public void whitespaceAttributeParseBug() throws Exception { String gtfRecord = "4\tensembl_havana\tgene\t7392435\t7442901\t.\t+\t.\tgene_id \"ENSDARG00000076014\"; note \"this is a note; with a delim\"; gene_version \"3\"; gene_name \"ERC1 (3 of 3)\"; gene_source \"ensembl_havana\"; gene_biotype \"protein_coding\""; Map<String, String> attributes = new HashMap<String, String>() {{ put("gene_id", "ENSDARG00000076014"); put("gene_version", "3"); put("gene_name", "ERC1 (3 of 3)"); put("gene_source", "ensembl_havana"); put("gene_biotype", "protein_coding"); put("note", "this is a note; with a delim"); }}; final Gtf expected = new Gtf("4", "ensembl_havana", "gene", 7392435, 7442901, ".", "+", ".", attributes); final GtfReader gtfReader = new GtfReader(new StringReader(gtfRecord)); final Gtf actual = gtfReader.read(); assertEquals(expected, actual); }