added JavaDoc for cons
added tests for cons