### Question:
MaxAngleKickRater { public static double getFoeScoreChanceWithDefender(final Collection<ITrackedBot> bots, final IVector2 origin) { Goal targetGoal = Geometry.getGoalOur(); if (isInTeamBot(bots, origin)) return 0; Optional<ValuePoint> target = getBestRatedDirectShotTarget(targetGoal, bots, origin); return target.map(ValuePoint::getValue).orElse(0.0); } private  MaxAngleKickRater(); static double getDirectShootScoreChance(final Collection<ITrackedBot> bots, final IVector2 origin); static double getScoreChanceFromAngle(double angle); static double getFoeScoreChanceWithDefender(final Collection<ITrackedBot> bots, final IVector2 origin); static Optional<ValuePoint> getBestRatedDirectShotTarget(Goal targetGoal,
			Collection<ITrackedBot> obstacleBots, IVector2 origin);  }### Answer:
@Test public void FoeLongDistanceTest() { double prob = MaxAngleKickRater.getFoeScoreChanceWithDefender(wf.getTigerBotsVisible().values(), Geometry.getGoalTheir().getCenter()); Assert.assertTrue(prob < 0.40); }
@Test public void FoeShortDistanceTest() { double biggestProb = 0; int testpoints = 8; IVector2 midpos = Geometry.getGoalOur().getCenter(); for (int i = 0; i < testpoints - 1; i++) { double a = Math.PI / 2 - (i + 1) * (Math.PI / testpoints); IVector2 addvec = Vector2.fromAngle(a).scaleTo(Geometry.getPenaltyAreaDepth()); IVector2 testpos = midpos.addNew(addvec); double prob = MaxAngleKickRater.getFoeScoreChanceWithDefender(wf.getTigerBotsVisible().values(), testpos); biggestProb = Math.max(biggestProb, prob); } Assert.assertTrue(biggestProb > 0.9); }
@Test public void FoeBehindBotsTest() { for (ITrackedBot bot : wf.getTigerBotsVisible().values()) { IVector2 dir = Vector2.fromPoints(Geometry.getGoalOur().getCenter(), bot.getPos()); dir = dir.scaleToNew(Geometry.getBotRadius() + Geometry.getBallRadius()); IVector2 pos = bot.getPos().addNew(dir); double prob = MaxAngleKickRater.getFoeScoreChanceWithDefender(wf.getTigerBotsVisible().values(), pos); Assert.assertTrue(prob < 1e-3); } }