// Path: app/src/main/java/com/mindbodyonline/ironhidetestapp/LongListActivity.java
// public class LongListActivity extends Activity {
// 
//     @VisibleForTesting
//     public static final String STR = "STR";
//     @VisibleForTesting
//     public static final String LEN = "LEN";
//     @VisibleForTesting
//     public static final String FOOTER = "FOOTER";
// 
//     private List<Map<String, Object>> data = new ArrayList<>();
//     private LayoutInflater layoutInflater;
// 
//     @Override
//     public void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
//         populateData();
//         setContentView(R.layout.list_activity);
//         ((TextView) findViewById(R.id.selection_row_value)).setText("");
//         ((TextView) findViewById(R.id.selection_column_value)).setText("");
// 
//         ListView listView = (ListView) findViewById(R.id.list);
//         String[] from = new String[] {STR, LEN};
//         int[] to = new int[] {R.id.item_content, R.id.item_size};
//         layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// 
//         ListAdapter adapter = new SimpleAdapter(this, data, R.layout.list_item, from, to) {
//             @Override
//             public View getView(final int position, View convertView, ViewGroup parent) {
//                 if (convertView == null) {
//                     convertView = layoutInflater.inflate(R.layout.list_item, null);
//                 }
// 
//                 TextView textViewOne = (TextView) convertView.findViewById(R.id.item_content);
//                 if (textViewOne != null) {
//                     textViewOne.setOnClickListener(new OnClickListener() {
//                         @Override
//                         public void onClick(View v) {
//                             ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//                             ((TextView) findViewById(R.id.selection_column_value)).setText("1");
//                         }
//                     });
//                 }
// 
//                 TextView textViewTwo = (TextView) convertView.findViewById(R.id.item_size);
//                 if (textViewTwo != null) {
//                     textViewTwo.setOnClickListener(new OnClickListener() {
//                         @Override
//                         public void onClick(View v) {
//                             ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//                             ((TextView) findViewById(R.id.selection_column_value)).setText("2");
//                         }
//                     });
//                 }
//                 return super.getView(position, convertView, parent);
//             }
//         };
// 
//         View footerView = layoutInflater.inflate(R.layout.list_item, listView, false);
//         ((TextView) footerView.findViewById(R.id.item_content)).setText("count:");
//         ((TextView) footerView.findViewById(R.id.item_size)).setText(String.valueOf(data.size()));
//         listView.addFooterView(footerView, FOOTER, true);
// 
//         listView.setAdapter(adapter);
//         listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//             @Override
//             public void onItemClick(
//                     AdapterView<?> unusedParent, View clickedView, int position, long id) {
//                 ((TextView) findViewById(R.id.selection_column_value)).setText("");
//                 ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//             }
//         });
//     }
// 
//     public Map<String, Object> makeItem(int forRow) {
//         Map<String, Object> dataRow = new HashMap<>();
//         dataRow.put(STR, "item: " + forRow);
//         dataRow.put(LEN, ((String) dataRow.get(STR)).length());
//         return dataRow;
//     }
// 
//     private void populateData() {
//         for (int i = 0; i < 100; i++) {
//             data.add(makeItem(i));
//         }
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/LongListMatchers.java
// public static Matcher<Object> withItemContent(String expectedText) {
//   // use preconditions to fail fast when a test is creating an invalid matcher.
//   checkNotNull(expectedText);
//   return withItemContent(equalTo(expectedText));
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/LongListMatchers.java
// public static Matcher<Object> withItemSize(int itemSize) {
//   // use preconditions to fail fast when a test is creating an invalid matcher.
//   checkArgument(itemSize > -1);
//   return withItemSize(equalTo(itemSize));
// }


import android.content.Intent;
import android.test.ActivityUnitTestCase;
import com.mindbodyonline.ironhidetestapp.LongListActivity;
import static android.support.test.espresso.matcher.ViewMatchers.assertThat;
import static com.mindbodyonline.ironhidetestapp.LongListMatchers.withItemContent;
import static com.mindbodyonline.ironhidetestapp.LongListMatchers.withItemSize;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalTo;
package com.mindbodyonline.ironhidetestapp.tests;




/**
 * UnitTests for LongListMatchers matcher factory.
 */
public final class LongListMatchersTest extends ActivityUnitTestCase<LongListActivity> {

  public LongListMatchersTest() {
    super(LongListActivity.class);
  }

  @Override
  public void setUp() throws Exception {
    super.setUp();
    startActivity(new Intent(getInstrumentation().getTargetContext(), LongListActivity.class),
        null, null);
  }

  public void testWithContent() {
// Path: app/src/main/java/com/mindbodyonline/ironhidetestapp/LongListActivity.java
// public class LongListActivity extends Activity {
// 
//     @VisibleForTesting
//     public static final String STR = "STR";
//     @VisibleForTesting
//     public static final String LEN = "LEN";
//     @VisibleForTesting
//     public static final String FOOTER = "FOOTER";
// 
//     private List<Map<String, Object>> data = new ArrayList<>();
//     private LayoutInflater layoutInflater;
// 
//     @Override
//     public void onCreate(Bundle bundle) {
//         super.onCreate(bundle);
//         populateData();
//         setContentView(R.layout.list_activity);
//         ((TextView) findViewById(R.id.selection_row_value)).setText("");
//         ((TextView) findViewById(R.id.selection_column_value)).setText("");
// 
//         ListView listView = (ListView) findViewById(R.id.list);
//         String[] from = new String[] {STR, LEN};
//         int[] to = new int[] {R.id.item_content, R.id.item_size};
//         layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// 
//         ListAdapter adapter = new SimpleAdapter(this, data, R.layout.list_item, from, to) {
//             @Override
//             public View getView(final int position, View convertView, ViewGroup parent) {
//                 if (convertView == null) {
//                     convertView = layoutInflater.inflate(R.layout.list_item, null);
//                 }
// 
//                 TextView textViewOne = (TextView) convertView.findViewById(R.id.item_content);
//                 if (textViewOne != null) {
//                     textViewOne.setOnClickListener(new OnClickListener() {
//                         @Override
//                         public void onClick(View v) {
//                             ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//                             ((TextView) findViewById(R.id.selection_column_value)).setText("1");
//                         }
//                     });
//                 }
// 
//                 TextView textViewTwo = (TextView) convertView.findViewById(R.id.item_size);
//                 if (textViewTwo != null) {
//                     textViewTwo.setOnClickListener(new OnClickListener() {
//                         @Override
//                         public void onClick(View v) {
//                             ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//                             ((TextView) findViewById(R.id.selection_column_value)).setText("2");
//                         }
//                     });
//                 }
//                 return super.getView(position, convertView, parent);
//             }
//         };
// 
//         View footerView = layoutInflater.inflate(R.layout.list_item, listView, false);
//         ((TextView) footerView.findViewById(R.id.item_content)).setText("count:");
//         ((TextView) footerView.findViewById(R.id.item_size)).setText(String.valueOf(data.size()));
//         listView.addFooterView(footerView, FOOTER, true);
// 
//         listView.setAdapter(adapter);
//         listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//             @Override
//             public void onItemClick(
//                     AdapterView<?> unusedParent, View clickedView, int position, long id) {
//                 ((TextView) findViewById(R.id.selection_column_value)).setText("");
//                 ((TextView) findViewById(R.id.selection_row_value)).setText(String.valueOf(position));
//             }
//         });
//     }
// 
//     public Map<String, Object> makeItem(int forRow) {
//         Map<String, Object> dataRow = new HashMap<>();
//         dataRow.put(STR, "item: " + forRow);
//         dataRow.put(LEN, ((String) dataRow.get(STR)).length());
//         return dataRow;
//     }
// 
//     private void populateData() {
//         for (int i = 0; i < 100; i++) {
//             data.add(makeItem(i));
//         }
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/LongListMatchers.java
// public static Matcher<Object> withItemContent(String expectedText) {
//   // use preconditions to fail fast when a test is creating an invalid matcher.
//   checkNotNull(expectedText);
//   return withItemContent(equalTo(expectedText));
// }
// 
// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/LongListMatchers.java
// public static Matcher<Object> withItemSize(int itemSize) {
//   // use preconditions to fail fast when a test is creating an invalid matcher.
//   checkArgument(itemSize > -1);
//   return withItemSize(equalTo(itemSize));
// }


// Path: app/src/androidTest/java/com/mindbodyonline/ironhidetestapp/tests/LongListMatchersTest.java
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import com.mindbodyonline.ironhidetestapp.LongListActivity;
import static android.support.test.espresso.matcher.ViewMatchers.assertThat;
import static com.mindbodyonline.ironhidetestapp.LongListMatchers.withItemContent;
import static com.mindbodyonline.ironhidetestapp.LongListMatchers.withItemSize;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.equalTo;

package com.mindbodyonline.ironhidetestapp.tests;




/**
 * UnitTests for LongListMatchers matcher factory.
 */
public final class LongListMatchersTest extends ActivityUnitTestCase<LongListActivity> {

  public LongListMatchersTest() {
    super(LongListActivity.class);
  }

  @Override
  public void setUp() throws Exception {
    super.setUp();
    startActivity(new Intent(getInstrumentation().getTargetContext(), LongListActivity.class),
        null, null);
  }

  public void testWithContent() {
    assertThat(getActivity().makeItem(54), withItemContent("item: 54"));