public static java.util.List<AminoAcidSequence> searchForPeptide(double massRangeStart, double massRangeEnd,
                                                           boolean isMonoMass, int numOfResidue) {
        java.util.List<AminoAcidSequence> aminoAcidSequences = new ArrayList<AminoAcidSequence>();
        AminoAcid[] acEntries = AminoAcid.values();

        // create all combinations.
        for (int i = 0; i < numOfResidue; i++) {
            java.util.List<AminoAcidSequence> tmpAminoAcidSequences = new ArrayList<AminoAcidSequence>();
            for (AminoAcid acEntry : acEntries) {
                if (i == 0) {
                    AminoAcidSequence aminoAcidSequence = new AminoAcidSequence(acEntry);
                    aminoAcidSequences.add(aminoAcidSequence);
                } else {
                    for (AminoAcidSequence aminoAcidSequence : aminoAcidSequences) {
                        AminoAcidSequence tmpAminoAcidSequence = new AminoAcidSequence();
                        tmpAminoAcidSequence.addAminoAcids(aminoAcidSequence.getAminoAcids());
                        tmpAminoAcidSequence.addAminoAcid(acEntry);
                        tmpAminoAcidSequences.add(tmpAminoAcidSequence);
                    }
                }
            }
            if (i != 0) {
                aminoAcidSequences = tmpAminoAcidSequences;
            }
        }

        // remove unqualified ones
        java.util.List<AminoAcidSequence> tmpAminoAcidSequences = new ArrayList<AminoAcidSequence>();
        for (AminoAcidSequence aminoAcidSequence : aminoAcidSequences) {
            double mass = isMonoMass ? aminoAcidSequence.getMonoMass() : aminoAcidSequence.getAvgMass();
            if (mass >= massRangeStart && mass <= massRangeEnd) {
                tmpAminoAcidSequences.add(aminoAcidSequence);
            }
        }
        aminoAcidSequences = tmpAminoAcidSequences;
        return aminoAcidSequences;
    }