added: javadoc and tests