Code example for HashMap

Methods: get, size

0
        Child child2 = new ChildBuilder().withId("59cd40f39ab6aa791f73885e3bdd99f9").withName("tester").withRev("4-b011946150a16b0d2c6271aed05e2abe").withCreatedBy("user1").build();
        repository.createOrUpdate(child1);
        repository.createOrUpdate(child2);
 
        HashMap<String, String> allIdsAndRevs = repository.getAllIdsAndRevs();
        assertEquals(2, allIdsAndRevs.size());
        assertEquals("5-1ed26a0e5072830a9064361a570684f6", allIdsAndRevs.get("dfb2031ebfcbef39dccdb468f5200edc"));
        assertEquals("4-b011946150a16b0d2c6271aed05e2abe", allIdsAndRevs.get("59cd40f39ab6aa791f73885e3bdd99f9"));
 
    } 
 
    @Test 
    public void shouldDeleteAllRecordOfAGivenUser() throws JSONException { 
        Child syncedChild = new Child("syncedID", "user1", null, true);
        Child unSyncedChild = new Child("unsyncedID", "user1", null, false);
        repository.createOrUpdate(syncedChild);
        repository.createOrUpdate(unSyncedChild);
 
        repository.deleteChildrenByOwner();
        assertEquals(0, repository.getChildrenByOwner().size());
    }