Added java solution to p4