import org.junit.Test;
import static org.junit.Assert.*;
public class TestPalindrome {
// You must use this palindrome, and not instantiate
// new Palindromes, or the autograder might be upset.
static Palindrome palindrome = new Palindrome();
@Test
public void testWordToDeque() {
Deque d = palindrome.wordToDeque("persiflage");
String actual = "";
for (int i = 0; i < "persiflage".length(); i++) {
actual += d.removeFirst();
}
assertEquals("persiflage", actual);
}
}
public class Palindrome{
public Deque<Character> wordToDeque(String word){
ArrayDeque<Character> c = new ArrayDeque();
for (char d : word.toCharArray()){
c.addLast(d);
}
return c;
}
}
The method wordToDeque can technically have anything in it (e.g. return null), but it still just gives me "no main error found." it's a little bit perplexing. The compiler recognizes junit as I've added it to my environment variables. Does anyone know why this is happening?