public boolean performClick() {
    boolean blockTouchEvent = doValidate(false) == ReturnState.STATE_ERROR;
    return blockTouchEvent;
  }
@Test
  public void testValidate() {
    AppCompatEditText textfield = new AppCompatEditText(context);
    WarnableTextInputLayout layout =
        new WarnableTextInputLayout(context, Robolectric.buildAttributeSet().build());
    AppCompatButton button = new AppCompatButton(context);
    WarnableTextInputValidator.OnTextValidate validator =
        text ->
            ("Pass".equals(text))
                ? new WarnableTextInputValidator.ReturnState(
                    WarnableTextInputValidator.ReturnState.STATE_NORMAL, R.string.ok)
                : new WarnableTextInputValidator.ReturnState(
                    WarnableTextInputValidator.ReturnState.STATE_ERROR, R.string.error);

    WarnableTextInputValidator target =
        new WarnableTextInputValidator(
            ApplicationProvider.getApplicationContext(), textfield, layout, button, validator);
    textfield.setText("");
    target.performClick();
    assertFalse(button.isEnabled());
    assertEquals(context.getString(R.string.error), layout.getError());
    textfield.setText("pass");
    target.performClick();
    assertFalse(button.isEnabled());
    assertEquals(context.getString(R.string.error), layout.getError());
    textfield.setText("Pass");
    target.performClick();
    assertTrue(button.isEnabled());
    assertNull(layout.getError());
  }