### Question:
Join extends Operator { public void rewind() throws DbException, TransactionAbortedException { left.rewind(); right.rewind(); joinReuslt.rewind(); } Join(JoinPredicate p, DbIterator child1, DbIterator child2); JoinPredicate getJoinPredicate(); String getJoinField1Name(); String getJoinField2Name(); TupleDesc getTupleDesc(); void open(); void close(); void rewind(); @Override DbIterator[] getChildren(); @Override void setChildren(DbIterator[] children); static final int blockMemory; }### Answer:
@Test public void rewind() throws Exception { JoinPredicate pred = new JoinPredicate(0, Predicate.Op.EQUALS, 0); Join op = new Join(pred, scan1, scan2); op.open(); while (op.hasNext()) { assertNotNull(op.next()); } assertTrue(TestUtil.checkExhausted(op)); op.rewind(); eqJoin.open(); Tuple expected = eqJoin.next(); Tuple actual = op.next(); assertTrue(TestUtil.compareTuples(expected, actual)); }