duplicated code removed, comment added for assertEquals