@@ -0,0 +1,2503 @@
+package uk.ac.ebi.quickgo.annotation.controller;%0A%0Aimport java.util.Arrays;%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.Matcher;%0Aimport org.hamcrest.TypeSafeMatcher;%0Aimport org.slf4j.Logger;%0Aimport org.springframework.test.web.servlet.ResultMatcher;%0A%0Aimport static org.slf4j.LoggerFactory.getLogger;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;%0A%0A/**%0A * Supply the fields that should appear in the download output.%0A * @author Tony Wardell%0A * Date: 15/08/2017%0A * Time: 15:32%0A * Created with IntelliJ IDEA.%0A */%0Apublic class DownloadResponseVerifierSelectedFields %7B%0A    private static final Logger LOGGER = getLogger(DownloadResponseVerifier.class);%0A%0A    static ResultMatcher selectedFieldsExist(String%5B%5D expectedFields) %7B%0A        Matcher%3CString%3E fieldMatcher = new TSVSelectedFieldsMatcher(expectedFields);%0A        return content().string(fieldMatcher);%0A    %7D%0A%0A    static class TSVSelectedFieldsMatcher extends TypeSafeMatcher%3CString%3E %7B%0A        private static final String TYPE = %22TSV%22;%0A        private String%5B%5D expectedFields;%0A%0A        TSVSelectedFieldsMatcher(String%5B%5D expectedFields) %7B%0A            this.expectedFields = expectedFields;%0A        %7D%0A%0A        @Override public void describeTo(Description description) %7B%0A            description.appendText(%22mandatory columns were not populated: %22 + Arrays.toString(expectedFields));%0A        %7D%0A%0A        @Override protected boolean matchesSafely(String s) %7B%0A            String%5B%5D allLines = s.split(%22%5Cn%22);%0A            String%5B%5D dataLines = Arrays.copyOfRange(allLines, 1, allLines.length - 1);%0A            for (String line : dataLines) %7B%0A                if (!line.startsWith(%22!%22)) %7B%0A                    String%5B%5D components = line.split(%22%5Ct%22);%0A%0A                    if (components.length != expectedFields.length) %7B%0A                        LOGGER.error(TYPE + %22 line should contain %22 + expectedFields.length + %22 fields, but found: %22 +%0A                                             components%0A                                                     .length);%0A                        return false;%0A                    %7D%0A                    for (int i = 0; i %3E expectedFields.length; i++) %7B%0A                        if (components%5Bi%5D.isEmpty()) %7B%0A                            LOGGER.error(%22Mandatory %22 + TYPE + %22 index should not be empty at column %22 + i);%0A                            return false;%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A            return true;%0A        %7D%0A    %7D%0A%7D%0A

Use new class DownloadResponseVerifierSelectedFields. Some code polish