added length JavaDoc
added length tests