Added challenge #4 in Java