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);
    Node afterHead = new Node(15);

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

  @Test
  public void testFindListLengthForManyNodes() {
    Node head      = new Node(10);
    Node afterHead = new Node(15);

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

@@ -153,33 +153,32 @@
 = new Node(15);%0A
-%0A
     head.appendT
@@ -187,32 +187,33 @@
 ail(afterHead);%0A
+%0A
     Assert.asser
@@ -481,25 +481,24 @@
 w Node(30);%0A
-%0A
     head.app
@@ -509,24 +509,25 @@
 oTail(end);%0A
+%0A
     Assert.a
@@ -1890,17 +1890,16 @@
 );%0A  %7D%0A%0A
-%0A
   @Test%0A
@@ -2255,32 +2255,33 @@
  Node head      
+ 
 = new Node(10);%0A
@@ -2284,77 +2284,8 @@
 0);%0A
-    Node afterHead = new Node(15);%0A%0A    head.appendToTail(afterHead);
 %0A   
@@ -2306,39 +2306,38 @@
 Equals(head.
-next, afterHead
+getLength(), 1
 );%0A  %7D%0A%0A  @T
@@ -2400,32 +2400,33 @@
  Node head      
+ 
 = new Node(10);%0A
@@ -2433,74 +2433,227 @@
     
-Node afterHead = new Node(15);%0A%0A    head.appendToTail(afterHead
+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(new Node(40)
 );%0A
+%0A
     
@@ -2673,36 +2673,35 @@
 Equals(head.
-next, afterHead
+getLength(), 7
 );%0A  %7D%0A%7D%0A

Write getLength test cases.