import org.junit.*;

public class NodeTest {

  @Test
  public void testAppendToTailToOneNode() {
    Node head      = new Node(10);
    Node afterHead = new Node(15);
    head.appendToTail(afterHead);

    Assert.assertEquals(head.next, afterHead);
  }

  @Test
  public void testAppendToTailToManyNodes() {
    Node head       = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));
    head.appendToTail(new Node(25));
    Node end        = new Node(30);
    head.appendToTail(end);

    Assert.assertEquals(head.next.next.next.next, end);
  }

  @Test
  public void testOddNodePalindrome() {
    Node head       = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(10));

    Assert.assertTrue(head.isPalindrome());
  }

  @Test
  public void testEvenNodePalindrome() {
    Node head       = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(10));

    Assert.assertTrue(head.isPalindrome());
  }

  @Test
  public void testInvalidPalindrome() {
    Node head       = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));
    head.appendToTail(new Node(15));

    Assert.assertFalse(head.isPalindrome());
  }

  @Test
  public void testOneNodePalindrome() {
    Node head      = new Node(10);

    Assert.assertTrue(head.isPalindrome());
  }

  @Test
  public void testOneNodeFindMedian() {
    Node head       = new Node(10);

    Assert.assertEquals(head.findMedianElement(), head);
  }

  @Test
  public void testOddNodeFindMedian() {
    Node medianNode = new Node(10);

    Node head       = new Node(5);
    head.appendToTail(medianNode);
    head.appendToTail(new Node(15));

    Assert.assertEquals(head.findMedianElement(), medianNode);
  }

  @Test
  public void testEvenNodeFindMedian() {
    Node medianNode = new Node(10);

    Node head       = new Node(5);
    head.appendToTail(medianNode);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));

    Assert.assertEquals(head.findMedianElement(), medianNode);
  }

  @Test
  public void testFindListLengthForOneNode() {
    Node head       = new Node(10);

    Assert.assertEquals(head.getLength(), 1);
  }

  @Test
  public void testFindListLengthForManyNodes() {
    Node head       = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));
    head.appendToTail(new Node(25));
    head.appendToTail(new Node(30));
    head.appendToTail(new Node(35));
    head.appendToTail(new Node(40));

    Assert.assertEquals(head.getLength(), 7);
  }
}

@@ -2697,11 +2697,979 @@
  7);%0A  %7D
+%0A%0A  @Test%0A  public void testCircularListOneNode() %7B%0A    Node head       = new Node(10);%0A    head.appendToTail(head);%0A%0A    Assert.assertTrue(head.isCircular());%0A  %7D%0A%0A  @Test%0A  public void testCircularListManyNodes() %7B%0A    Node head       = new Node(10);%0A    head.appendToTail(new Node(15));%0A    head.appendToTail(new Node(20));%0A    head.appendToTail(new Node(25));%0A    head.appendToTail(new Node(30));%0A    head.appendToTail(new Node(35));%0A    head.appendToTail(head);%0A%0A    Assert.assertTrue(head.isCircular());%0A  %7D%0A%0A  @Test%0A  public void testNonCircularOneNode() %7B%0A    Node head       = new Node(10);%0A%0A    Assert.assertFalse(head.isCircular());%0A  %7D%0A%0A%0A  @Test%0A  public void testNonCircularManyNode() %7B%0A    Node head       = new Node(10);%0A    head.appendToTail(new Node(15));%0A    head.appendToTail(new Node(20));%0A    head.appendToTail(new Node(25));%0A    head.appendToTail(new Node(30));%0A    head.appendToTail(new Node(35));%0A%0A    Assert.assertFalse(head.isCircular());%0A  %7D
 %0A%7D%0A

Write isCircular tests.