    @SuppressWarnings("unchecked")
    @Test
    public void write() throws IOException {

        subject.write(RpslObject.parse("mntner: DEV-MNT1"), Collections.EMPTY_LIST);
        subject.write(RpslObject.parse("mntner: DEV-MNT2"), Collections.EMPTY_LIST);
        subject.write(RpslObject.parse("mntner: DEV-MNT3"), Collections.EMPTY_LIST);
        subject.write(RpslObject.parse("mntner: DEV-MNT4"), Collections.EMPTY_LIST);
        subject.write(RpslObject.parse("inetnum: 193.0.0.0 - 193.0.0.10"), Collections.EMPTY_LIST);
        subject.write(RpslObject.parse("route: 193.0.0.0 - 193.0.0.10\norigin: AS12"), Lists.newArrayList(new Tag(CIString.ciString("foo"), 3, "bar")));
        subject.close();

        final File[] files = folder.getRoot().listFiles();
        Assert.assertNotNull(files);
        Assert.assertThat(files.length, Matchers.is(21));

        for (final File file : files) {
            final String fileName = file.getName();
            if (fileName.endsWith("mntner.gz")) {
                checkFile(file, "" +
                        "mntner:         DEV-MNT1\n" +
                        "\n" +
                        "mntner:         DEV-MNT2\n" +
                        "\n" +
                        "mntner:         DEV-MNT3\n" +
                        "\n" +
                        "mntner:         DEV-MNT4\n");
            } else if (fileName.endsWith("inetnum.gz")) {
                checkFile(file, "" +
                        "inetnum:        193.0.0.0 - 193.0.0.10\n");
            } else if (fileName.endsWith("route.gz")) {
                checkFile(file, "" +
                        "route:          193.0.0.0 - 193.0.0.10\n" +
                        "origin:         AS12\n\n" +
                        QueryMessages.tagInfoStart("193.0.0.0 - 193.0.0.10AS12") +
                        QueryMessages.tagInfo("foo", "bar"));
            }
        }
    }