@Test
  public void shouldGenerateUniqueId() throws JSONException {
    Child child = new Child(null, "rapidftr", null);
    child = spy(child);

    doReturn("xyz").when(child).createUniqueId();

    child.generateUniqueId();
    assertThat(child.getUniqueId(), equalTo("xyz"));
  }
 @Test
 public void shouldNotOverwriteIdIfAlreadyPresent() throws JSONException {
   Child child = new Child("id1", "owner1", null);
   child.generateUniqueId();
   assertThat(child.getUniqueId(), equalTo("id1"));
 }