public static NotControllerException newPreMigrationException(OptionalInt controllerId) {
        if (controllerId.isPresent()) {
            return new NotControllerException("The controller is in pre-migration mode.");
        } else {
            return new NotControllerException("No controller appears to be active.");
        }
    }
@Test
    public void testNewPreMigrationExceptionWithActiveController() {
        assertExceptionsMatch(new NotControllerException("The controller is in pre-migration mode."),
            newPreMigrationException(OptionalInt.of(1)));
    }