Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/util/LinkedListTest.java
/*
 * #%L
 * Evaluation
 * %%
 * Copyright (C) 2016 Github jjYBdx4IL Projects
 * %%
 * #L%
 */
package tests.java.util;

import java.util.LinkedList;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 *
 * @author Github jjYBdx4IL Projects
 */
public class LinkedListTest {

    @Test
    public void testStack() {
        LinkedList<String> list = new LinkedList<>();
        list.push("1");
        list.push("2");
        assertEquals(2, list.size());
        assertEquals("2", list.pop());
        assertEquals(1, list.size());
        assertEquals("1", list.pop());
        assertEquals(0, list.size());
    }

    @Test
    public void testFIFOQueue() {
        LinkedList<String> list = new LinkedList<>();
        list.add("1");
        list.add("2");
        assertEquals(2, list.size());
        assertEquals("1", list.pop());
        assertEquals(1, list.size());
        assertEquals("2", list.pop());
        assertEquals(0, list.size());
    }
}
-------------------------------------------------------------------------------
Test set: tests.java.util.LinkedListTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in tests.java.util.LinkedListTest
testStack  Time elapsed: 0 s
testFIFOQueue  Time elapsed: 0 s