Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/util/LinkedHashSetTest.java
package tests.java.util;

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

import org.junit.Test;

import java.util.LinkedHashSet;
import java.util.NoSuchElementException;

public class LinkedHashSetTest {

    @Test
    public void test() {
        LinkedHashSet<String> lhm = new LinkedHashSet<>();
        try {
            lhm.iterator().next();
            fail();
        } catch (NoSuchElementException ex) {
        }
        lhm.add("one");
        assertEquals("one", lhm.iterator().next());
    }
}
-------------------------------------------------------------------------------
Test set: tests.java.util.LinkedHashSetTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in tests.java.util.LinkedHashSetTest
test  Time elapsed: 0 s