public static void main(String[] args) {

        List<Rider> riders = new ArrayList<Rider>();

        riders.add(new Rider("John", 170));
        riders.add(new Rider("Giant", 230));
        riders.add(new Rider("Bob", 5));
        riders.add(new Rider("Shadhow", -1));

        Map<Raceable, Integer> raceables = new HashMap<Raceable, Integer>();

        for (Rider rider : riders) {
            raceables.put(AnimalFactory.getInstance().createAnimal(rider), 0);
        }

        int round = 10;
        int firstDistance = 0;
        for (int i = 0; i < round; i++) {
            for (Raceable raceable : raceables.keySet()) {
                int runDistance = 0;

                if (raceable instanceof AbstractRaceAnimal && firstDistance > raceables.get(raceable)) {
                    runDistance = ((AbstractRaceAnimal) raceable).run(new RaceBehavior() {

                        @Override
                        public int getRunDistance() {
                            return 25;
                        }
                    });
                } else {
                    runDistance = raceable.run();
                }

                if (raceables.get(raceable) + runDistance > firstDistance) {
                    firstDistance = raceables.get(raceable) + runDistance;
                }
                raceables.put(raceable, raceables.get(raceable) + runDistance);
            }
        }

        Raceable winner = null;
        int maxDistance = 0;
        for (Raceable raceable : raceables.keySet()) {
            if (raceables.get(raceable) > maxDistance) {
                maxDistance = raceables.get(raceable);
                winner = raceable;
            }

        }
        winner.onWin();
        System.out.println(String.format("winner runs %d miles ", raceables.get(winner)));
    }