Issue with nested query in Junits