Added java part of the assignment