Skip to content

Instantly share code, notes, and snippets.

@KevinTyrrell
Last active December 18, 2018 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinTyrrell/eb7cd6c35b31b64f08852b4781003cb6 to your computer and use it in GitHub Desktop.
Save KevinTyrrell/eb7cd6c35b31b64f08852b4781003cb6 to your computer and use it in GitHub Desktop.
public class B
{
public static List<B> transform(List<A> as)
{
try
{
return as.stream()
.map(a ->
{
if (a.nope()) throw new Exception();
return new B(a.getName());
}
.collect(Collections.toList());
}
catch (Exception e) { return null; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment