// Path: RecordingLib/src/com/vpedak/testsrecorder/core/Espresso.java
// public class Espresso extends Subject {
// 
//     public void accept(StringBuilder sb, TestGenerator generator){
//         generator.generateSubject(sb, this);
//     }
// }
// 
// Path: RecordingLib/src/com/vpedak/testsrecorder/core/events/Data.java
// public class Data extends Subject {
//     private String adapterId;
//     private String className;
//     private String value;
// 
//     public Data(String adapterId, String className) {
//         this.adapterId = adapterId;
//         this.className = className;
//     }
//     public Data(String adapterId, String className, String value) {
//         this.adapterId = adapterId;
//         this.className = className;
//         this.value = value;
//     }
// 
//     public String getAdapterId() {
//         return adapterId;
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public void accept(StringBuilder sb, TestGenerator generator){
//         generator.generateSubject(sb, this);
//     }
// }
// 
// Path: RecordingLib/src/com/vpedak/testsrecorder/core/TestGenerator.java
// public interface TestGenerator {
//     String generate(String activityClassName, String testClassName, String packageName, List<RecordingEvent> events);
// 
//     void generateEvent(StringBuilder sb, RecordingEvent event);
// 
//     void generateSubject(StringBuilder sb, Subject subject);
//     void generateSubject(StringBuilder sb, View subject);
//     void generateSubject(StringBuilder sb, DisplayedView subject);
//     void generateSubject(StringBuilder sb, OptionsMenu subject);
//     void generateSubject(StringBuilder sb, MenuItem subject);
//     void generateSubject(StringBuilder sb, ParentView subject);
//     void generateSubject(StringBuilder sb, ParentIdView subject);
//     void generateSubject(StringBuilder sb, Data subject);
//     void generateSubject(StringBuilder sb, Espresso subject);
// 
//     void generateActon(StringBuilder sb, Action action, Subject subject);
//     void generateActon(StringBuilder sb, ClickAction action, Subject subject);
//     void generateActon(StringBuilder sb, LongClickAction action, Subject subject);
//     void generateActon(StringBuilder sb, ReplaceTextAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeUpAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeDownAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeLeftAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeRightAction action, Subject subject);
//     void generateActon(StringBuilder sb, PressBackAction action, Subject subject);
//     void generateActon(StringBuilder sb, ScrollToPositionAction action, Subject subject);
//     void generateActon(StringBuilder sb, SelectViewPagerPageAction action, Subject subject);
//     void generateActon(StringBuilder sb, ScrollToAction action, Subject subject);
// }


import com.vpedak.testsrecorder.core.Espresso;
import com.vpedak.testsrecorder.core.events.Data;
import com.vpedak.testsrecorder.core.TestGenerator;
import com.vpedak.testsrecorder.core.events.*;
import java.util.List;
        sb.append("onView(withText(\"").append(subject.getTitle()).append("\")).");
    }

    @Override
    public void generateSubject(StringBuilder sb, ParentView subject) {
        wasParentView = true;
        sb.append("onView(nthChildOf(withId(").append(subject.getParentId()).append("), ").append(subject.getChildIndex()).append(")).");
    }

    @Override
    public void generateSubject(StringBuilder sb, ParentIdView subject) {
        sb.append("onView(allOf(withParent(withId(").append(subject.getParentId()).
                append(")), withId(").append(subject.getChildId()).append("))).");
    }

    @Override
    public void generateSubject(StringBuilder sb, Data subject) {
        if (subject.getValue() != null) {
            sb.append("onData(allOf(is(instanceOf(").append(subject.getClassName()).append(".class)), is(\"").
                    append(subject.getValue()).append("\"))).inAdapterView(withId(").append(subject.getAdapterId()).
                    append(")).");
        } else {
            StringBuilder tmp = new StringBuilder(dataTemplate);
            replace( tmp, "CLASS", subject.getClassName());
            replace( tmp, "ADAPTER_ID", subject.getAdapterId());
            sb.append(tmp);
        }
    }

    @Override
// Path: RecordingLib/src/com/vpedak/testsrecorder/core/Espresso.java
// public class Espresso extends Subject {
// 
//     public void accept(StringBuilder sb, TestGenerator generator){
//         generator.generateSubject(sb, this);
//     }
// }
// 
// Path: RecordingLib/src/com/vpedak/testsrecorder/core/events/Data.java
// public class Data extends Subject {
//     private String adapterId;
//     private String className;
//     private String value;
// 
//     public Data(String adapterId, String className) {
//         this.adapterId = adapterId;
//         this.className = className;
//     }
//     public Data(String adapterId, String className, String value) {
//         this.adapterId = adapterId;
//         this.className = className;
//         this.value = value;
//     }
// 
//     public String getAdapterId() {
//         return adapterId;
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public void accept(StringBuilder sb, TestGenerator generator){
//         generator.generateSubject(sb, this);
//     }
// }
// 
// Path: RecordingLib/src/com/vpedak/testsrecorder/core/TestGenerator.java
// public interface TestGenerator {
//     String generate(String activityClassName, String testClassName, String packageName, List<RecordingEvent> events);
// 
//     void generateEvent(StringBuilder sb, RecordingEvent event);
// 
//     void generateSubject(StringBuilder sb, Subject subject);
//     void generateSubject(StringBuilder sb, View subject);
//     void generateSubject(StringBuilder sb, DisplayedView subject);
//     void generateSubject(StringBuilder sb, OptionsMenu subject);
//     void generateSubject(StringBuilder sb, MenuItem subject);
//     void generateSubject(StringBuilder sb, ParentView subject);
//     void generateSubject(StringBuilder sb, ParentIdView subject);
//     void generateSubject(StringBuilder sb, Data subject);
//     void generateSubject(StringBuilder sb, Espresso subject);
// 
//     void generateActon(StringBuilder sb, Action action, Subject subject);
//     void generateActon(StringBuilder sb, ClickAction action, Subject subject);
//     void generateActon(StringBuilder sb, LongClickAction action, Subject subject);
//     void generateActon(StringBuilder sb, ReplaceTextAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeUpAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeDownAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeLeftAction action, Subject subject);
//     void generateActon(StringBuilder sb, SwipeRightAction action, Subject subject);
//     void generateActon(StringBuilder sb, PressBackAction action, Subject subject);
//     void generateActon(StringBuilder sb, ScrollToPositionAction action, Subject subject);
//     void generateActon(StringBuilder sb, SelectViewPagerPageAction action, Subject subject);
//     void generateActon(StringBuilder sb, ScrollToAction action, Subject subject);
// }


// Path: src/com/vpedak/testsrecorder/plugin/core/EspressoTestGenerator.java
import com.vpedak.testsrecorder.core.Espresso;
import com.vpedak.testsrecorder.core.events.Data;
import com.vpedak.testsrecorder.core.TestGenerator;
import com.vpedak.testsrecorder.core.events.*;
import java.util.List;

        sb.append("onView(withText(\"").append(subject.getTitle()).append("\")).");
    }

    @Override
    public void generateSubject(StringBuilder sb, ParentView subject) {
        wasParentView = true;
        sb.append("onView(nthChildOf(withId(").append(subject.getParentId()).append("), ").append(subject.getChildIndex()).append(")).");
    }

    @Override
    public void generateSubject(StringBuilder sb, ParentIdView subject) {
        sb.append("onView(allOf(withParent(withId(").append(subject.getParentId()).
                append(")), withId(").append(subject.getChildId()).append("))).");
    }

    @Override
    public void generateSubject(StringBuilder sb, Data subject) {
        if (subject.getValue() != null) {
            sb.append("onData(allOf(is(instanceOf(").append(subject.getClassName()).append(".class)), is(\"").
                    append(subject.getValue()).append("\"))).inAdapterView(withId(").append(subject.getAdapterId()).
                    append(")).");
        } else {
            StringBuilder tmp = new StringBuilder(dataTemplate);
            replace( tmp, "CLASS", subject.getClassName());
            replace( tmp, "ADAPTER_ID", subject.getAdapterId());
            sb.append(tmp);
        }
    }

    @Override
    public void generateSubject(StringBuilder sb, Espresso subject) {