@Test public void testFilterCollection() throws Exception { DiscardEmptyValuesFilter filter = new DiscardEmptyValuesFilter(); MetadataCollection c = filter.filter(new MetadataCollection(createMessage().getMetadata())); assertEquals(3, c.size()); }
@Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); for (MetadataElement element : original) { if (!StringUtils.isEmpty(element.getValue())) { result.add(element); } } return result; }
DiscardEmptyValuesFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); for (MetadataElement element : original) { if (!StringUtils.isEmpty(element.getValue())) { result.add(element); } } return result; } }
DiscardEmptyValuesFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); for (MetadataElement element : original) { if (!StringUtils.isEmpty(element.getValue())) { result.add(element); } } return result; } DiscardEmptyValuesFilter(); }
DiscardEmptyValuesFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); for (MetadataElement element : original) { if (!StringUtils.isEmpty(element.getValue())) { result.add(element); } } return result; } DiscardEmptyValuesFilter(); @Override MetadataCollection filter(MetadataCollection original); }
DiscardEmptyValuesFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); for (MetadataElement element : original) { if (!StringUtils.isEmpty(element.getValue())) { result.add(element); } } return result; } DiscardEmptyValuesFilter(); @Override MetadataCollection filter(MetadataCollection original);  }