EventWriter { public void write(MotionEvent e) throws IOException { Log.d(TAG, screenSize.toString()); TouchEvent te = new TouchEvent(e, screenSize); write(te); } EventWriter(OutputStream os, Point screen, int orientation); void write(MotionEvent e); void close();  }
@Test public void writeMotionEvents() throws IOException { ew.write(test); MotionEvent result = obtainOutput(new Point(1, 1)); assertEventEquals(test, result); }
@Test public void writeTouchEvents() throws IOException{ TouchEvent testevent = serializeEvent(test); ew.write(testevent); MotionEvent result = obtainOutput(); assertEventEquals(test, result); }