@Override
    public synchronized boolean isValid(final Gene[] genes, final Supergene supergene) {
        subset.clear();
        int previous = -1;
        for (final Gene gene : genes) {
            final int element = (Integer) gene.getAllele();

            if (element <= previous) {
                // force increasing order of element to avoid considering order permutations
                return false;
            }
            subset.add(element);
            previous = element;
        }
        // valid solutions have no duplicate elements.
        return subset.size() == genes.length;
    }