@Test
  public void
      givenAPropertyViewAttributeWithTwoWayBinding_whenTheViewIsUpdated_thenViewShouldNotReceiveAFurtherUpdate() {
    setupAndBindAttribute(TWO_WAY_BINDING, DONT_PRE_INITIALIZE_VIEW);

    attribute.simulateViewUpdate(A_NEW_VALUE);

    assertThat(attribute.viewUpdateNotificationCount, is(0));
  }
  @Test
  public void
      givenAPropertyViewAttributeWithTwoWayBinding_whenTheViewIsUpdated_thenValueModelShouldBeUpdated() {
    setupAndBindAttribute(TWO_WAY_BINDING, DONT_PRE_INITIALIZE_VIEW);

    attribute.simulateViewUpdate(A_NEW_VALUE);

    assertThat(valueModel.getValue(), is(A_NEW_VALUE));
  }
  @Test
  public void
      givenATwoWayBindingViewAttributeOfAlwaysRestoreValueProperty_whenTheViewIsUpdated_thenViewShouldReceiveAnUpdateWithRestoredValue() {
    attribute =
        aPropertyViewAttributeSpy()
            .withPreInitializeView(false)
            .withTwoWaybinding(true)
            .withPropertyName(PROPERTY_NAME)
            .build();
    valueModel = new AlwaysRestoreValueModel();
    bindAttribute(TWO_WAY_BINDING, DONT_PRE_INITIALIZE_VIEW);

    attribute.simulateViewUpdate(A_NEW_VALUE);

    assertThat(attribute.viewUpdateNotificationCount, is(1));
    assertThat(attribute.updatedValue, is(AlwaysRestoreValueModel.ALWAYS_RESTORE_VALUE));
  }