ChildRepository implements Repository<Child> { @Override public Child get(String id) throws JSONException { @Cleanup Cursor cursor = session.rawQuery("SELECT child_json, synced FROM children WHERE id = ?", new String[]{id}); if (cursor.moveToNext()) { return childFrom(cursor); } else { throw new NullPointerException(id); } } @Inject  ChildRepository(@Named("USER_NAME") String userName, DatabaseSession session, RapidFtrApplication applicationInstance); @Override Child get(String id); @Override boolean exists(String childId); @Override int size(); @Override List<Child> getRecordsBetween(int fromPageNumber, int pageNumber); @Override List<Child> allCreatedByCurrentUser(); @Override List<Child> getRecordsForFirstPage(); @Override ArrayList<String> getRecordIdsByOwner(); void deleteChildrenByOwner(); @Override void createOrUpdate(Child child); @Override void createOrUpdateWithoutHistory(Child child); @Override List<Child> toBeSynced(); @Override List<Child> currentUsersUnsyncedRecords(); @Override // TODO remove this method - we no longer want to work out what to updateWithoutHistory by comparing _revs HashMap<String, String> getAllIdsAndRevs(); @Override void close(); List<Child> getChildrenByIds(ArrayList<String> listOfIds); List<Child> getAllWithInternalIds(List<String> internalIds); List<Child> getFirstPageOfChildrenMatchingString(String searchKey); List<Child> getChildrenMatchingStringBetween(
            String searchKey, int fromPageNumber, int toPageNumber);  }
@Test(expected = NullPointerException.class) public void getShouldThrowExceptionIfRecordDoesNotExist() throws JSONException { repository.get("blah"); }