Answered You can hire a professional tutor to get the answer.
please help me finish last part in this assignment(DNA.Java), I also uploaded the test case below and the format in picture. please use the software intelij I copy the assignment link below:https://c
please help me finish last part in this assignment(DNA.Java), I also uploaded the test case below and the format in picture.
please use the software intelij
- I copy the assignment link below:https://cs125.cs.illinois.edu/MP/5/?from=singlemessage&isappinstalled=0
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;
import org.testng.annotations.Test;
import junit.framework.Assert;
/**
* Test suite for the DNA class.
*
* The provided test suite is correct and complete. You should not need to modify it. However, you
* should understand it.
*
* @see < a href=" ">MP5 Documentation
*/
public class DNATest {
/** Timeout for DNA tests. Solution takes 713 ms.*/
private static final int DNA_TEST_TIMEOUT = 7130;
/**
* Test longest common subsequence.
*/
@Test(timeOut = DNA_TEST_TIMEOUT)
public void testLongestCommonSubsequence() {
for (DNATestResult testResult : PRECOMPUTED_DNA_TEST_RESULTS) {
String lcs = DNA.getLongestCommonSubsequence(testResult.firstSequence,
testResult.secondSequence).getSequence().toUpperCase();
Assert.assertTrue(testResult.longestCommonSubsequences.contains(lcs));
}
}
/**
* Class for storing trees and pre-computed results for the DNA tests.
*/
public static class DNATestResult {
/** First DNA sequence to compare. */
DNA firstSequence;
/** Second DNA sequence to compare. */
DNA secondSequence;
/** Result of the comparison. */
List longestCommonSubsequences;
/**
* Create a new input for the DNA tests.
*
* @param setFirstSequence first DNA sequence to compare
* @param setSecondSequence second DNA sequence to compare
* @param setLongestCommonSubsequences result of the comparison
*/
public DNATestResult(final DNA setFirstSequence, final DNA setSecondSequence,
final List setLongestCommonSubsequences) {
firstSequence = setFirstSequence;
secondSequence = setSecondSequence;
longestCommonSubsequences = setLongestCommonSubsequences;
}
}
/** Pre-computed DNA results to use for testing. */
private static final List PRECOMPUTED_DNA_TEST_RESULTS = //
new ArrayList();
static {
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("ACTG"), new DNA("ACTG"), Collections.singletonList(
"ACTG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("ACTG"), new DNA("AACCTTGG"), Collections.singletonList(
"ACTG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("AACC"), new DNA("TTGG"), Collections.singletonList(
""
)));
/* BEGIN AUTOGENERATED CODE */
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("gtcGCATtGCA"),
new DNA("ActTtCGCt"), Arrays.asList(
"TCGCT",
"TTTGC",
"CTTGC",
"ATTGC"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("gAAaTaCAAaAaAAt"),
new DNA("aCcT"), Collections.singletonList(
"ACT"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("aCCGTAaCt"),
new DNA("AAaG"), Collections.singletonList(
"AAA"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("agTCTccgTTCT"),
new DNA("AGCcccG"), Arrays.asList(
"AGCCCG",
"AGCCCC"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("aCCTtccaatT"),
new DNA("AaGCagaCtt"), Collections.singletonList(
"ACAATT"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("GTGtaaTCtt"),
new DNA("TcTcACct"), Collections.singletonList(
"TTACT"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("GtcCGCC"),
new DNA("cTgTaC"), Arrays.asList(
"GTC",
"TGC",
"CGC"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("AtattcGaT"),
new DNA("cGaGTaagcAgt"), Arrays.asList(
"ATACGT",
"ATACAT",
"ATAGAT"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("GCTgGTAgtGaAGc"),
new DNA("TCATgccATaA"), Collections.singletonList(
"CTGATAA"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("CCTTcCGGatGtTT"),
new DNA("AGctAcACA"), Collections.singletonList(
"CTCCA"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("GCgcTaTcttcg"),
new DNA("cGCTAGCTAaTGGAGA"), Collections.singletonList(
"CGCTACTTG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("cCGaCGgGTg"),
new DNA("ggCTG"), Arrays.asList(
"GCTG",
"GGTG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("aTtAcgtcaGCAg"),
new DNA("GaaGaacGgTaTGgac"), Arrays.asList(
"AACGTAGC",
"AACGTAGA",
"AACGTAGG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("gTgCagcTctgGtc"),
new DNA("GACTtCaTtgCcTAcG"), Arrays.asList(
"GTCAGCTCG",
"GTCAGCCTG",
"GTCAGCCTC",
"GTCATTGTC",
"GACTCTGTC"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("tGaAagctGg"),
new DNA("TGTagTT"), Collections.singletonList(
"TGAGT"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("aTtATG"),
new DNA("TcGcaTgT"), Collections.singletonList(
"TATG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("taCA"),
new DNA("CttataTcCcGGGcC"), Arrays.asList(
"TAC",
"TAA"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("ccCAG"),
new DNA("CGtTAta"), Arrays.asList(
"CA",
"CG"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("AaGtCGTcC"),
new DNA("gTAatcgGcaCA"), Collections.singletonList(
"AATCGCC"
)));
PRECOMPUTED_DNA_TEST_RESULTS.add(new DNATestResult(
new DNA("AtGCtCaATGTTgGtg"),
new DNA("CGGGCattACcCA"), Arrays.asList(
"ATCCA",
"ATTCA",
"GCTCA",
"ATTAA",
"GCTAA",
"GCATT",
"CCATT",
"CGGGT"
)));
/* END AUTOGENERATED CODE */
}
- }