### Question:
PubmedSearch { public List<Integer> searchIds(String query) throws RemoteException { EUtilsServiceStub.ESearchRequest req = new EUtilsServiceStub.ESearchRequest(); req.setDb("pubmed"); req.setEmail("georges@gmail.com"); req.setTerm(query); req.setRetStart("0"); req.setRetMax(Integer.MAX_VALUE + ""); EUtilsServiceStub.ESearchResult res = service.run_eSearch(req); int count = new Integer(res.getCount()); LOG.debug("Found {} ids for query '{}'", count, query); List<Integer> articleIds = new ArrayList<Integer>(); if (count==0) return articleIds; String[] idList = res.getIdList().getId(); for (String id : idList) { articleIds.add(new Integer(id)); } assert (count == articleIds.size()) : "result counts should match, " + articleIds.size() + ":" + count; return articleIds; } PubmedSearch(); Iterator<PubmedArticleType> search(String query); List<Integer> searchIds(String query); Iterator<PubmedArticleType> search(String query, int maxNrResults);  }### Answer:
@Test public void testMesh() throws Exception { List<Integer> articles = new PubmedSearch().searchIds("Axons[mesh]"); assertTrue(articles.size() > 10000); }
@Test public void testPmid() throws Exception { List<Integer> articles = new PubmedSearch().searchIds("16381840[pmid]"); assertTrue(articles.size() == 1); articles = new PubmedSearch().searchIds("16381840"); assertTrue(articles.size() == 1); articles = new PubmedSearch().searchIds("17170002 16381840"); assertTrue(articles.size() == 2); }