public static TestFrameWriter create(Collection<FrameWriterOperation> exceptionThrowingOperations, Collection<FrameWriterOperation> errorThrowingOperations, boolean deepCopyInputFrames) { CountAnswer openAnswer = createAnswer(FrameWriterOperation.Open, exceptionThrowingOperations, errorThrowingOperations); CountAnswer nextAnswer = createAnswer(FrameWriterOperation.NextFrame, exceptionThrowingOperations, errorThrowingOperations); CountAnswer flushAnswer = createAnswer(FrameWriterOperation.Flush, exceptionThrowingOperations, errorThrowingOperations); CountAnswer failAnswer = createAnswer(FrameWriterOperation.Fail, exceptionThrowingOperations, errorThrowingOperations); CountAnswer closeAnswer = createAnswer(FrameWriterOperation.Close, exceptionThrowingOperations, errorThrowingOperations); return new TestFrameWriter(openAnswer, nextAnswer, flushAnswer, failAnswer, closeAnswer, deepCopyInputFrames); }