@Test(expected = NullPointerException.class) public void testExtractValuesForNullApprover() { Collection<StructuredProperty> source = Lists.newArrayList(); String validValue = "someValue"; source.add(generateStructuredProperty(validValue, null)); MetadataConverterUtils.extractValues(source, null); }
public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); }
MetadataConverterUtils { public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); } }
MetadataConverterUtils { public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); } private  MetadataConverterUtils(); }
MetadataConverterUtils { public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); } private  MetadataConverterUtils(); static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover); static Year extractYearOrNull(String date, Logger log); }
MetadataConverterUtils { public static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover) { return source.stream() .filter(x -> fieldApprover.approve(x.getDataInfo())) .map(StructuredProperty::getValue) .filter(StringUtils::isNotBlank) .collect(Collectors.toList()); } private  MetadataConverterUtils(); static List<String> extractValues(Collection<StructuredProperty> source, FieldApprover fieldApprover); static Year extractYearOrNull(String date, Logger log);  }