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()
  public void testInsertModelBefore() {
    TestModel firstModel = new TestModel();
    testAdapter.addModels(firstModel);
    testAdapter.insertModelBefore(new TestModel(), firstModel);

    verify(observer, times(2)).onItemRangeInserted(0, 1);
    assertEquals(2, testAdapter.models.size());
    assertEquals(firstModel, testAdapter.models.get(1));

    checkDifferState();
  }