@Nullable
  public static EpoxyModel<?> getModelFromPayload(List<Object> payloads, long modelId) {
    if (payloads.isEmpty()) {
      return null;
    }

    for (Object payload : payloads) {
      DiffPayload diffPayload = (DiffPayload) payload;

      if (diffPayload.singleModel != null) {
        if (diffPayload.singleModel.id() == modelId) {
          return diffPayload.singleModel;
        }
      } else {
        EpoxyModel<?> modelForId = diffPayload.modelsById.get(modelId);
        if (modelForId != null) {
          return modelForId;
        }
      }
    }

    return null;
  }
@Test
  public void getMultipleModelsFromMultipleDiffPayloads() {
    TestModel model1Payload1 = new TestModel(1);
    TestModel model2Payload1 = new TestModel(2);
    DiffPayload diffPayload1 = diffPayloadWithModels(model1Payload1, model2Payload1);

    TestModel model1Payload2 = new TestModel(3);
    TestModel model2Payload2 = new TestModel(4);
    DiffPayload diffPayload2 = diffPayloadWithModels(model1Payload2, model2Payload2);

    List<Object> payloads = payloadsWithDiffPayloads(diffPayload1, diffPayload2);

    EpoxyModel<?> model1FromPayload1 = getModelFromPayload(payloads, model1Payload1.id());
    EpoxyModel<?> model2FromPayload1 = getModelFromPayload(payloads, model2Payload1.id());
    EpoxyModel<?> model1FromPayload2 = getModelFromPayload(payloads, model1Payload2.id());
    EpoxyModel<?> model2FromPayload2 = getModelFromPayload(payloads, model2Payload2.id());

    assertEquals(model1Payload1, model1FromPayload1);
    assertEquals(model2Payload1, model2FromPayload1);
    assertEquals(model1Payload2, model1FromPayload2);
    assertEquals(model2Payload2, model2FromPayload2);
  }