@@ -0,0 +1,2438 @@
+package uk.ac.ebi.atlas.experimentimport.analyticsindex.support;%0A%0Aimport com.google.common.collect.LinkedListMultimap;%0Aimport com.google.common.collect.Multimap;%0Aimport org.hamcrest.Matchers;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0A%0Aimport javax.inject.Inject;%0Aimport java.util.Collection;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Aimport static org.hamcrest.Matchers.greaterThan;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.fail;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@WebAppConfiguration%0A@ContextConfiguration(locations = %7B%22classpath:applicationContext.xml%22, %22classpath:solrContextIT.xml%22, %22classpath:oracleContext.xml%22%7D)%0Apublic class IdentifierSearchTermsTraderIT %7B%0A%0A%0A    @Inject%0A    IdentifierSearchTermsTrader subject;%0A%0A    @Test%0A    public void testGetBioentityIdToIdentifierSearchMap() throws Exception %7B%0A%0A        Map%3CString,String%3E result = subject.getBioentityIdToIdentifierSearchMap(%22E-MTAB-2836%22);%0A        //smaller %22E-GEOD-22351%22%0A%0A        assertThat(result.size(), greaterThan(0));%0A%0A        for(Map.Entry%3CString,String%3E e: result.entrySet()) %7B%0A            Map%3CString, Collection%3CString%3E%3E x = identifierSearchAsMap(e.getValue());%0A%0A            Set%3CString%3E bioentityIdentifiersWithoutSymbols = new HashSet%3C%3E();%0A%0A%0A            if(x.get(%22symbol%22) == null %7C%7C x.get(%22symbol%22).size()==0)%7B%0A                bioentityIdentifiersWithoutSymbols.add(e.getKey());%0A            %7D else if(x.get(%22symbol%22).size()%3E1)%7B%0A                fail(%22Ambiguous symbols %22+x.get(%22symbol%22) +%22 for accession %22+ e.getKey());%0A            %7D%0A            assertThat(bioentityIdentifiersWithoutSymbols, Matchers.%3CString%3Eempty());%0A%0A        %7D%0A        //TODO interesting stuff potentially%0A        //One gene is failing this, when you run it for all experiments!: TRAES3BF003300090CFD_g%0A%0A    %7D%0A%0A    private Map%3CString, Collection%3CString%3E%3E identifierSearchAsMap(String v)%7B%0A        Multimap%3CString, String%3E map = LinkedListMultimap.create();%0A        Matcher m = Pattern.compile(%22(%5C%5Cw+):%5C%5C%7B(%5B%5E%5C%5C%7D%5D+)%5C%5C%7D%22).matcher(v);%0A        while (m.find()) %7B%0A            map.put(m.group(1), m.group(2));%0A        %7D%0A        return map.asMap();%0A    %7D%0A%7D

Test for the identifier search that I found useful in understanding the functionality