SampleWrapper implements BioMoleculeWrapperI { @Override public Set<String> getAllSampleMetaAreas(){ Set<String> areas = new HashSet<String>(); for(SampleMeta sm : this.getAllSampleMeta()){ areas.add(MetaHelper.getAreaFromMeta(sm)); } return areas; } SampleWrapper(Sample sample); @Override List<SampleMeta> getAllSampleMeta(); @Override Sample getSampleObject(); @Override SampleWrapper getParentWrapper(); @Override Set<String> getAllSampleMetaAreas(); @Override List<SampleMeta> getMetaTemplatedToSampleSybtype(SampleSubtype sampleSubtype); @Override void setParent(Sample parentSample); @Override List<SampleMeta> updateMetaToList(List<SampleMeta> inputMetaList, SampleMetaDao sampleMetaDao); @Override void saveAll(SampleService sampleService);  }
@Test (groups = "unit-tests", dependsOnMethods = {"testSampleWrapperConstruct"}) public void testGetAllSampleMetaAreas(){ SampleWrapper managedSample = new SampleWrapper(sample); List<String> areas = new ArrayList<String>(); areas.addAll(managedSample.getAllSampleMetaAreas()); Assert.assertEquals(areas.size(), 2); Assert.assertTrue(areas.contains("sampleMeta1")); Assert.assertTrue(areas.contains("parentSampleMeta2")); }