Skip to content

Instantly share code, notes, and snippets.

@vple
Created May 27, 2018 15:06
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 vple/cc4663ab12478b22b1385155fa19cf06 to your computer and use it in GitHub Desktop.
Save vple/cc4663ab12478b22b1385155fa19cf06 to your computer and use it in GitHub Desktop.
Initial matches color spec
/**
* Determines if the given objects have the specified color.
*/
public class MatchesColorSpec {
public static boolean isSatisfiedBy(Color color, Collection<Colored> objects) {
return objects.stream()
.allMatch(object -> object.hasColor(color));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment