private void loadSampleToCaArraySampleMap() {
   nameToCaArraySampleMap = new HashMap<String, Biomaterial>();
   try {
     List<Biomaterial> samples =
         CaArrayUtils.getSamples(getGenomicSource().getExperimentIdentifier(), searchService);
     for (Biomaterial biomaterial : samples) {
       nameToCaArraySampleMap.put(biomaterial.getName(), biomaterial);
     }
   } catch (ExperimentNotFoundException e) {
     throw new IllegalStateException("Couldn't retrieve valid experiment");
   }
 }
 protected List<Hybridization> getHybridizations(Biomaterial caArraySample)
     throws InvalidInputException {
   HybridizationSearchCriteria criteria = new HybridizationSearchCriteria();
   Set<CaArrayEntityReference> sourceSet = new HashSet<CaArrayEntityReference>();
   sourceSet.add(caArraySample.getReference());
   criteria.setBiomaterials(sourceSet);
   return getSearchService().searchForHybridizations(criteria, null).getResults();
 }
 private void printBiomaterialDetails(Biomaterial biomaterial) {
   // Print basic biomaterial attributes.
   System.out.print(biomaterial.getName() + "\t");
   System.out.print(biomaterial.getType() + "\t");
   Term term = biomaterial.getTissueSite() == null ? null : biomaterial.getTissueSite().getTerm();
   String termVal = term == null ? null : term.getValue();
   System.out.print(termVal + "\t");
   term = biomaterial.getDiseaseState() == null ? null : biomaterial.getDiseaseState().getTerm();
   termVal = term == null ? null : term.getValue();
   System.out.println(termVal);
 }