@Test
public void exists() {

    Id dbId = new Id("idp:a:angrybirds", "core_exists_db");
    try {
        Database db = Service.database(dbId);
        // We have not created the database yet so Exists should fail.
        assertFalse(db.exists());
        // The instance is empty so creating of a database should succeed.
        db.create(anyDbPermissions());
        // Exists should succeed now.
        assertTrue(db.exists());
    } catch (VError vError) {
        vError.printStackTrace();
        fail(vError.toString());
    }
}