Collection { public void create(Permissions permissions) throws VError { io.v.syncbase.internal.Collection.Create(fullName, batchHandle, permissions); } Collection(String parentFullName, Id id, String batchHandle); Id id(); Permissions getPermissions(); void setPermissions(Permissions permissions); void create(Permissions permissions); void destroy(); boolean exists(); Row row(String key); byte[] get(String key); void put(String key, byte[] value); void delete(String key); void deleteRange(byte[] start, byte[] limit);  }
@Test public void create() { Id dbId = new Id("idp:a:angrybirds", "core_create_collection"); Id collectionId1 = new Id("...", "collection1"); Id collectionId2 = new Id("...", "collection2"); try { Database db = Service.database(dbId); db.create(anyDbPermissions()); BatchDatabase batchDb = db.beginBatch(null); batchDb.collection(collectionId1).create(anyCollectionPermissions()); batchDb.collection(collectionId2).create(anyCollectionPermissions()); List<Id> collections = batchDb.listCollections(); assertNotNull(collections); assertEquals(2, collections.size()); assertEquals(collectionId1.encode(), collections.get(0).encode()); assertEquals(collectionId2.encode(), collections.get(1).encode()); } catch (VError vError) { vError.printStackTrace(); fail(vError.toString()); } }