Use 2.7.0-rc1 in Maven-based samples

Change-Id: I06e7c4aaf57b9c29355e506190879804f8519bd3
Fixes nits, codestyle and an issue from review 9913.

Change-Id: I378eb937d49f3d91b8e2b9a8647aa9c82a90dd15
(cherry picked from commit dc29057ae311304036c86d93305821039ea81aef)