@Override
    public int hashCode() {
        return executionId.hashCode() + executionState.ordinal();
    }
@Test
    public void testSerialization() {
        try {
            final ExecutionAttemptID executionId = createExecutionAttemptId();
            final ExecutionState state = ExecutionState.DEPLOYING;
            final Throwable error = new IOException("fubar");

            TaskExecutionState original1 = new TaskExecutionState(executionId, state, error);
            TaskExecutionState original2 = new TaskExecutionState(executionId, state);

            TaskExecutionState javaSerCopy1 = CommonTestUtils.createCopySerializable(original1);
            TaskExecutionState javaSerCopy2 = CommonTestUtils.createCopySerializable(original2);

            // equalities
            assertEquals(original1, javaSerCopy1);
            assertEquals(javaSerCopy1, original1);

            assertEquals(original2, javaSerCopy2);
            assertEquals(javaSerCopy2, original2);

            // hash codes
            assertEquals(original1.hashCode(), javaSerCopy1.hashCode());
            assertEquals(original2.hashCode(), javaSerCopy2.hashCode());
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }