@Test
public void testToastInvalidChild() throws JSONException {

    Child child = mock(Child.class);
    when(child.isValid()).thenReturn(false);
    activity.child = child;
    activity.save();
    assertThat(ShadowToast.getTextOfLatestToast(), equalTo(activity.getString(R.string.save_child_invalid)));
}