Java Doc comments and pre conditions

Adding pre conditions (double check them and test)