Allow consolidating config in root context with Java

Issue: SPR-11357
(backported from 4.0.1)
Polishing

Issue: SPR-11357
Added test for SpringProperties setFlag method

Issue: SPR-9014
Issue: SPR-11297