new java solution