Collection { public Syncgroup getSyncgroup() { if (mDatabaseHandle instanceof BatchDatabase) { throw new IllegalArgumentException("Must not call getSyncgroup within batch"); } return ((Database) mDatabaseHandle).getSyncgroup(getId()); } Collection(io.v.syncbase.core.Collection coreCollection, DatabaseHandle databaseHandle); Id getId(); Syncgroup getSyncgroup(); T get(String key, Class<T> cls); boolean exists(String key); void put(String key, T value); void delete(String key); AccessList getAccessList(); void updateAccessList(final AccessList delta);  }
@Test public void attemptGetSyncgroupWithinBatch() throws SyncbaseException, ExecutionException, InterruptedException { BatchDatabase batch = Syncbase.database().beginBatch(new Database.BatchOptions()); Collection collection = batch.createCollection( new CollectionOptions().setWithoutSyncgroup(true)); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Must not call getSyncgroup within batch"); collection.getSyncgroup(); }