public static String getName(int error) {
        switch(error) {
            case UNKNOWN_CONFIG:             return "UNKNOWN_CONFIG";
            case UNKNOWN_DEFINITION:         return "UNKNOWN_DEFINITION";
            case UNKNOWN_DEF_MD5:            return "UNKNOWN_DEF_MD5";
            case ILLEGAL_NAME:               return "ILLEGAL_NAME";
            case ILLEGAL_VERSION:            return "ILLEGAL_VERSION";
            case ILLEGAL_CONFIGID:           return "ILLEGAL_CONFIGID";
            case ILLEGAL_DEF_MD5:            return "ILLEGAL_DEF_MD5";
            case ILLEGAL_CONFIG_MD5:         return "ILLEGAL_CONFIG_MD5";
            case ILLEGAL_TIMEOUT:            return "ILLEGAL_TIMEOUT";
            case ILLEGAL_GENERATION:         return "ILLEGAL_GENERATION";
            case ILLEGAL_SUB_FLAG:           return "ILLEGAL_SUBSCRIBE_FLAG";
            case ILLEGAL_NAME_SPACE:         return "ILLEGAL_NAME_SPACE";
            case ILLEGAL_CLIENT_HOSTNAME:    return "ILLEGAL_CLIENT_HOSTNAME";
            case OUTDATED_CONFIG:            return "OUTDATED_CONFIG";
            case INTERNAL_ERROR:             return "INTERNAL_ERROR";
            case APPLICATION_NOT_LOADED:     return "APPLICATION_NOT_LOADED";
            case ILLEGAL_PROTOCOL_VERSION:   return "ILLEGAL_PROTOCOL_VERSION";
            case INCONSISTENT_CONFIG_MD5:    return "INCONSISTENT_CONFIG_MD5";
            case UNKNOWN_VESPA_VERSION:      return "UNKNOWN_VESPA_VERSION";
            case INCOMPATIBLE_VESPA_VERSION: return "INCOMPATIBLE_VESPA_VERSION";
            default:                         return "Unknown error (error code " + error + ")";
        }
    }
@Test
    public void basic() {
        assertThat(ErrorCode.getName(ErrorCode.INTERNAL_ERROR), is("INTERNAL_ERROR"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_CONFIG_MD5), is("ILLEGAL_CONFIG_MD5"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_CONFIGID), is("ILLEGAL_CONFIGID"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_DEF_MD5), is("ILLEGAL_DEF_MD5"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_GENERATION), is("ILLEGAL_GENERATION"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_NAME), is("ILLEGAL_NAME"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_SUB_FLAG), is("ILLEGAL_SUBSCRIBE_FLAG"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_TIMEOUT), is("ILLEGAL_TIMEOUT"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_VERSION), is("ILLEGAL_VERSION"));
        assertThat(ErrorCode.getName(ErrorCode.OUTDATED_CONFIG), is("OUTDATED_CONFIG"));
        assertThat(ErrorCode.getName(ErrorCode.UNKNOWN_CONFIG), is("UNKNOWN_CONFIG"));
        assertThat(ErrorCode.getName(ErrorCode.UNKNOWN_DEF_MD5), is("UNKNOWN_DEF_MD5"));
        assertThat(ErrorCode.getName(ErrorCode.UNKNOWN_DEFINITION), is("UNKNOWN_DEFINITION"));
        assertThat(ErrorCode.getName(ErrorCode.UNKNOWN_VESPA_VERSION), is("UNKNOWN_VESPA_VERSION"));
        assertThat(ErrorCode.getName(ErrorCode.INCONSISTENT_CONFIG_MD5), is("INCONSISTENT_CONFIG_MD5"));
        assertThat(ErrorCode.getName(ErrorCode.ILLEGAL_CLIENT_HOSTNAME), is("ILLEGAL_CLIENT_HOSTNAME"));

        assertThat(ErrorCode.getName(12345), is("Unknown error (error code 12345)"));
    }