We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
give predicate as a parameter :
public static Stream<Object> getPrivateStream(List<TPrivate> privates, Predicate<TPrivate> predicate) { return privates .stream() .filter(predicate) .map(TAnyContentFromOtherNamespace::getContent) .flatMap(List::stream) .filter(JAXBElement.class::isInstance) .map(JAXBElement.class::cast) .filter(Predicate.not(JAXBElement::isNil)) .map(JAXBElement::getValue); }
Refactor all calls to other "getPrivateStream" method
Here is the test :
@Test void getPrivate_should_filter() { //Given Predicate<TPrivate> icdHeaderPredicate = tPrivate -> "COMPAS-SclFileType".equals(tPrivate.getType()); Predicate<TPrivate> systemVersionPredicate = tPrivate -> "COMPAS-SystemVersion".equals(tPrivate.getType()); Predicate<TPrivate> predicate = icdHeaderPredicate.or(systemVersionPredicate); //When Stream<Object> privateStream = PrivateUtils.getPrivateStream(List.of(privateSCD, privateICD), predicate); //Then assertThat(privateStream.toList()).isNotEmpty(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
give predicate as a parameter :
Refactor all calls to other "getPrivateStream" method
Here is the test :
The text was updated successfully, but these errors were encountered: