class ChordSelector implements IChordSelector {

    public HiveChord getChordTwoBarsPrior(HiveChord currentChord, List<HiveChord> hiveChordInDatabase) {

        List<HiveChord> chordCandidates = getChordCandidatesTwoBarsPrior(currentChord, hiveChordInDatabase);

        int max = chordCandidates.size();
        int randomIndex = new Random().nextInt(max);

        HiveChord chordCandidate = chordCandidates.get(randomIndex);

        if (chordCandidate == null) {
            return null;
        }

        return chordCandidate;
    }

}