### Question:
Author extends AbstractNode { public String getFirstName() { return this.firstName; } Author(String rawAuthorText, int origin);  Author(String rawAuthorText, int origin, IncitesInstitutionLocationMap locationMap); void addInstitution(String institution); void addPublication(Publication publication); double getExpectedCitations(); @Override boolean equals(Object other); void format(); @Override CyNode getCyNode(); String getDepartment(); String getFirstInitial(); String getFirstName(); String getInstitution(); List<String> getInstitutions(); @Override String getLabel(); String getLastName(); String getLocation(); String getMainInstitution(); @Override Map<String, Object> getNodeAttrMap(); int getOrigin(); List<String> getPubList(); int getTimesCited(); boolean hasAlreadyBeenAdded(); @Override int hashCode(); boolean isIdentified(); void prioritizeInstitution(Author author, Author otherAuthor); void setAlreadyBeenAdded(boolean alreadyBeenAdded); @Override void setCyNode(CyNode cyNode); void setDepartment(String department); void setFirstInitial(String firstInitial); void setFirstName(String firstName); @Override void setLabel(String label); void setLastName(String lastName); void setLocation(String location); void setMainInstitution(String mainInstitution); void setMiddleInitial(String middleInitial); @Override void setNodeAttrMap(Map<String, Object> attrMap); void setOrigin(int origin); void setPubList(List<String> pubList); void setTimesCited(int timesCited); @Override String toString();  }### Answer:
@Test public void testVerifyFirstNameA() { Author author1 = new Author("Kofia, Victro (UNIV TORONTO)", Category.INCITES); Author author2 = new Author("Kofia, Victor (UNIV TORONTO)", Category.INCITES); Author author3 = null; HashMap<Author, Author> authorMap = new HashMap<Author, Author>(); authorMap.put(author2, author2); boolean switched = true; author3 = authorMap.get(author1); if (author3 != null) { switched = !author3.getFirstName().equalsIgnoreCase(author2.getFirstName()); } assertTrue(!switched); }
@Test public void testVerifyFirstNameB() { Author author1 = new Author("Kofia, V (UNIV TORONTO)", Category.INCITES); Author author2 = new Author("Kofia, Victor (UNIV TORONTO)", Category.INCITES); Author author3 = null; HashMap<Author, Author> authorMap = new HashMap<Author, Author>(); authorMap.put(author2, author2); boolean switched = true; author3 = authorMap.get(author1); if (author3 != null) { switched = !author3.getFirstName().equalsIgnoreCase(author2.getFirstName()); } assertTrue(!switched); }
@Test public void testFixDefectiveFirstName() { Author author1 = new Author("Kofia, Victor (UNIV TORONTO)", Category.INCITES); Author author2 = new Author("Kofia, Vica (UNIV TORONTO)", Category.INCITES); Author check = null; HashMap<Author, Author> authorMap = new HashMap<Author, Author>(); authorMap.put(author2, author2); boolean fixed = false; check = authorMap.get(author1); if (check != null) { fixed = author2.getFirstName().equalsIgnoreCase(author1.getFirstName()); } assertTrue(fixed); }
@Test public void testFixFirstName() { Author author1 = new Author("Kofia, Victor (UNIV TORONTO)", Category.INCITES); Author author2 = new Author("Kofia, V (UNIV TORONTO)", Category.INCITES); Object check = null; HashMap<Author, Author> authorMap = new HashMap<Author, Author>(); authorMap.put(author2, author2); boolean switched = false; check = authorMap.get(author1); if (check != null) { switched = author2.getFirstName().equalsIgnoreCase(author1.getFirstName()); } assertTrue(switched); }