protected void insertModelBefore(EpoxyModel<?> modelToInsert, EpoxyModel<?> modelToInsertBefore) {
    int targetIndex = getModelPosition(modelToInsertBefore);
    if (targetIndex == -1) {
      throw new IllegalStateException("Model is not added: " + modelToInsertBefore);
    }

    pauseModelListNotifications();
    models.add(targetIndex, modelToInsert);
    resumeModelListNotifications();

    notifyItemInserted(targetIndex);
  }
@Test(expected = IllegalStateException.class)
  public void testInsertModelBeforeThrowsForInvalidModel() {
    testAdapter.insertModelBefore(new TestModel(), new TestModel());
  }