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