Contains only java Solution