Example usage for java.util SortedSet first

List of usage examples for java.util SortedSet first

Introduction

In this page you can find the example usage for java.util SortedSet first.

Prototype

E first();

Source Link

Document

Returns the first (lowest) element currently in this set.

Usage

From source file:net.sourceforge.fenixedu.domain.student.Registration.java

private RegistrationState getFirstRegistrationState(final RegistrationStateType stateType) {
    final SortedSet<RegistrationState> states = new TreeSet<RegistrationState>(
            RegistrationState.DATE_COMPARATOR);
    states.addAll(getRegistrationStates(stateType));
    return states.first();
}

From source file:com.google.gwt.emultest.java.util.TreeSetTest.java

/**
 * Test method for 'java.util.SortedSet.first()'.
 *
 * @see java.util.SortedSet#first()/*from  www.j  a  va 2s  . c  o  m*/
 */
public void testFirstKey_throwsNoSuchElementException() {
    SortedSet<E> SortedSet = createNavigableSet();
    // test with no entries
    try {
        SortedSet.first();
        fail("expected exception");
    } catch (NoSuchElementException e) {
        // expected outcome
    }
}