title: How to set visibility of the textview using android espresso test
body: <p>I want to set visibility for the text view from test cases.I am using espresso for testing the UI. I used the viewAction to set the text to the text view. But I want to set visibility for the text view. Please, any one helps me to resolve this issue.
  Here is my code for setting the text to the text view.</p>
  
  <pre><code>public ViewAction setTextInTextView(final String value){
      return new ViewAction() {
          @SuppressWarnings("unchecked")
          @Override
          public void perform(UiController uiController, View view) {
              ((TextView) view).setText(value);
          }
  
          @Override
          public Matcher&lt;View&gt; getConstraints() {
              return allOf(isDisplayed(), isAssignableFrom(TextView.class));
          }
  
          @Override
          public String getDescription() {
              return "replace text";
          }
      };
  } 
  </code></pre>