Added test case for DATAMONGO-540

Added test case for DATAMONGO-540 - please verify. The use case mentioned in DATAMONGO-540 
seems to work as desired.