I want to group the Java agent and the Webserver agent under one grouping the Dynatrace client.
Will it impact anything or else mapping both under one group will be fine?
There is no impact on the way the agents function and transactions will be tracked just the same.
Then only differences you will notice will be on the Transaction Flow as your groups will contain both these agents instead of separating them. Additionally, when you use dashlets like the Response Time Hotspots (when grouping by tier) it may be more useful to have a separation between these agents.
Other than that, everything works the same.