### Question:
StatementGroup { public int evaluate(Map<String, Object> data) { LOG.info("Evaluating score on data using {} statements", statements.size()); long start = System.currentTimeMillis(); Integer score = statements .parallelStream() .map(s -> s.evaluate(data)) .reduce(0, Integer::sum); LOG.info("... returning {} as score calculated in {} ms", score, System.currentTimeMillis() -start); return score; } StatementGroup(List<? extends Statement> statements); int evaluate(Map<String, Object> data);  }### Answer:
@Test public void one_statement() { StatementGroup group = new StatementGroup(asList(new FixedScoreStatement(10))); assertEquals(10, group.evaluate(IGNORED_DATA)); }
@Test public void multiple_statements() { StatementGroup group = new StatementGroup(asList(new FixedScoreStatement(10), new FixedScoreStatement(10))); assertEquals(20, group.evaluate(IGNORED_DATA)); }
@Test public void multiple_mvel_statements() { Map<String, Object> data = new HashMap<>(); data.put("email", "fraudster@gmail.com"); StatementGroup group = new StatementGroup(asList( new MVELStatement("1 * 2 * 3"), new MVELBooleanStatement("email ~= '.*fraud.*'", 1000), new MVELBooleanStatement("email ~= '.*abc.*'", 1000), new MVELBooleanStatement("email ~= '.*c123.*'", 1000), new MVELBooleanStatement("email ~= '.*au.*'", 1000) )); assertTrue(group.evaluate(data) > 1000); }