Scoring { @UserFunction @Description("apoc.scoring.existence(5, true) returns the provided score if true, 0 if false") public double existence( final @Name("score") long score, final @Name("exists") boolean exists) { return (double) (exists ? score : 0); }  @UserFunction @Description("apoc.scoring.existence(5, true) returns the provided score if true, 0 if false") double existence(
            final @Name("score") long score,
            final @Name("exists") boolean exists); @UserFunction @Description("apoc.scoring.pareto(10, 20, 100, 11) applies a Pareto scoring function over the inputs") double pareto(
            final @Name("minimumThreshold") long minimumThreshold,
            final @Name("eightyPercentValue") long eightyPercentValue,
            final @Name("maximumValue") long maximumValue,
            final @Name("score") long score);  }
@Test public void existence() throws Exception { TestUtil.testCall(db, "RETURN apoc.scoring.existence(10,true) as score", (row) -> assertEquals(10D,row.get("score"))); TestUtil.testCall(db, "RETURN apoc.scoring.existence(10,false) as score", (row) -> assertEquals(0D,row.get("score"))); }