Buggy code:
public class TaxamoApi { String basePath = "https:////api.taxamo.com" ; ApiInvoker apiInvoker = new ApiInvoker ( ) ; public TaxamoApi ( String apiToken ) { } public ApiInvoker getInvoker ( ) { } public void setBasePath ( String basePath ) { } public String getBasePath ( ) { } public CreateRefundOut createRefund ( String key , CreateRefundIn body ) throws ApiException { } public CreatePaymentOut createPayment ( String key , CreatePaymentIn body ) throws ApiException { } public ListPaymentsOut listPayments ( String limit , String offset , String key ) throws ApiException { } public CapturePaymentOut capturePayment ( String key ) throws ApiException { } public CreateTransactionOut createTransaction ( CreateTransactionIn body ) throws ApiException { } public GetTransactionOut getTransaction ( String key ) throws ApiException { } public UpdateTransactionOut updateTransaction ( String key , UpdateTransactionIn body ) throws ApiException { } public ConfirmTransactionOut confirmTransaction ( String key , ConfirmTransactionIn body ) throws ApiException { } public CancelTransactionOut cancelTransaction ( String key ) throws ApiException { } public ListTransactionsOut listTransactions ( String statuses , Boolean sortReverse , String taxCountryCode , String orderDateFrom , String keyOrCustomId , Integer offset , String filterText , String format , String orderDateTo , String currencyCode , Integer limit ) throws ApiException { } public CalculateTaxOut calculateTax ( CalculateTaxIn body ) throws ApiException { } public CalculateSimpleTaxOut calculateSimpleTax ( String buyerCreditCardPrefix , String buyerTaxNumber , String productType , String forceCountryCode , BigDecimal quantity , BigDecimal unitPrice , BigDecimal totalAmount , Boolean taxDeducted , BigDecimal amount , String billingCountryCode , String currencyCode , String orderDate ) throws ApiException { } public ValidateTaxNumberOut validateTaxNumber ( String countryCode , String taxNumber ) throws ApiException { if ( taxNumber == null ) { throw new ApiException ( 400 , "missing<seq2seq4repair_space>required<seq2seq4repair_space>params" ) ; } <START_BUG> String path = "//api//v1//tax//vat_numbers//{tax_number}//validate" . replaceAll ( "\\{format\\}" , "json" ) . replaceAll ( ( "\\{" + ( "taxNumber" + "\\}" ) ) , apiInvoker . escapeString ( taxNumber . toString ( ) ) ) ; <END_BUG> Map < String , String > queryParams = new HashMap < String , String > ( ) ; Map < String , String > headerParams = new HashMap < String , String > ( ) ; Map < String , String > formParams = new HashMap < String , String > ( ) ; if ( ! ( "null" . equals ( String . valueOf ( countryCode ) ) ) ) queryParams . put ( "country_code" , String . valueOf ( countryCode ) ) ; String [ ] contentTypes = new String [ ] { "application//json" } ; String contentType = ( ( contentTypes . length ) > 0 ) ? contentTypes [ 0 ] : "application//json" ; try { String response = apiInvoker . invokeAPI ( basePath , path , "GET" , queryParams , null , headerParams , formParams , contentType ) ; if ( response != null ) { return ( ( ValidateTaxNumberOut ) ( ApiInvoker . deserialize ( response , "" , ValidateTaxNumberOut . class ) ) ) ; } else { return null ; } } catch ( ApiException ex ) { if ( ( ex . getCode ( ) ) == 404 ) { return null ; } else { throw ex ; } } } public CalculateTaxLocationOut calculateTaxLocation ( String billingCountryCode , String buyerCreditCardPrefix ) throws ApiException { } public LocateMyIPOut locateMyIP ( ) throws ApiException { } public LocateGivenIPOut locateGivenIP ( String ip ) throws ApiException { } public GetTransactionsStatsOut getTransactionsStats ( String dateFrom , String dateTo , String interval ) throws ApiException { } public GetSettlementStatsByCountryOut getSettlementStatsByCountry ( String dateFrom , String dateTo ) throws ApiException { } public GetSettlementStatsByTaxationTypeOut getSettlementStatsByTaxationType ( String dateFrom , String dateTo ) throws ApiException { } public GetRefundsOut getRefunds ( String format , String mossCountryCode , String dateFrom ) throws ApiException { } public GetSettlementOut getSettlement ( String format , String mossCountryCode , String quarter ) throws ApiException { } public GetSettlementSummaryOut getSettlementSummary ( String mossCountryCode , String quarter ) throws ApiException { } public CreateSMSTokenOut createSMSToken ( CreateSMSTokenIn body ) throws ApiException { } public VerifySMSTokenOut verifySMSToken ( String token ) throws ApiException { } public GetCurrenciesDictOut getCurrenciesDict ( ) throws ApiException { } public GetProductTypesDictOut getProductTypesDict ( ) throws ApiException { } public GetCountriesDictOut getCountriesDict ( Boolean taxSupported ) throws ApiException { } }

Fix:
String path = "//api//v1//tax//vat_numbers//{tax_number}//validate" . replaceAll ( "\\{format\\}" , "json" ) . replaceAll ( ( "\\{" + ( "tax_number" + "\\}" ) ) , apiInvoker . escapeString ( taxNumber ) ) ;