JUnit tests for ReferenceList class and some changes to the class