src/test/java/tech/zettervall/openlibrary/rxclient/models/SubjectTest.java
/**
     * Test the natural sorting of Subject Objects.
     */
Test the natural sorting of Subject Objects.
Test the natural sorting of Subject Objects .
@Test
    public void compareTo() {
        List<Subject> subjects = new ArrayList<>();
        subjects.add(Subject.newSubjectForTesting("C"));
        subjects.add(Subject.newSubjectForTesting("A"));
        subjects.add(Subject.newSubjectForTesting("B"));
        Collections.sort(subjects);
        assertEquals("A", subjects.get(0).getName());
        assertEquals("B", subjects.get(1).getName());
        assertEquals("C", subjects.get(2).getName());
    }
@ Test public void compareTo ( ) { List < Subject > subjects = new ArrayList < > ( ) ; subjects . add ( Subject . newSubjectForTesting ( "C" ) ) ; subjects . add ( Subject . newSubjectForTesting ( "A" ) ) ; subjects . add ( Subject . newSubjectForTesting ( "B" ) ) ; Collections . sort ( subjects ) ; assertEquals ( "A" , subjects . get ( 0 ) . getName ( ) ) ; assertEquals ( "B" , subjects . get ( 1 ) . getName ( ) ) ; assertEquals ( "C" , subjects . get ( 2 ) . getName ( ) ) ; }
Test the natural sorting of Subject Objects.
Test the natural sorting of Subject Objects .
// A // B // C