Buggy code:
public class ApiConnection { static final Logger logger = LoggerFactory . getLogger ( ApiConnection . class ) ; URL url ; String key ; String userAgent ; transient HttpClient client ; boolean debug ; private TimeZone freshBooksTimeZone ; protected ApiConnection ( ) { } public ApiConnection ( URL apiUrl , String key , String userAgent ) { } public ApiConnection ( URL apiUrl , String key , String userAgent , String freshBooksTimeZoneId ) { } private HttpClient getClient ( ) { } protected void checkRequestAndOmitFields ( Request request , XStream xs ) { if ( request . getMethod ( ) . equals ( "invoice.update" ) ) { if ( ( ( request . getInvoice ( ) . getLines ( ) ) == null ) || ( ( request . getInvoice ( ) . getLines ( ) . size ( ) ) == 0 ) ) { xs . omitField ( Invoice . class , "lines" ) ; } } else if ( request . getMethod ( ) . equals ( "recurring.update" ) ) { <START_BUG> if ( ( ( request . getInvoice ( ) . getLines ( ) ) == null ) || ( ( request . getInvoice ( ) . getLines ( ) . size ( ) ) == 0 ) ) { <END_BUG> xs . omitField ( Recurring . class , "lines" ) ; } } } protected Response performRequest ( Request request ) throws ApiException , IOException { } public Long createInvoice ( Invoice invoice ) throws ApiException , IOException { } public Long createItem ( Item item ) throws ApiException , IOException { } public Long createClient ( Client client ) throws ApiException , IOException { } public Long createCallback ( Callback callback ) throws ApiException , IOException { } public Long createPayment ( Payment payment ) throws ApiException , IOException { } public Long createRecurring ( Recurring recurring ) throws ApiException , IOException { } public URL getUrl ( ) { } public void setUrl ( URL apiUrl ) { } public String getKey ( ) { } public void setKey ( String key ) { } public Iterable < Invoice > listInvoices ( final Integer perPage , final Date dateFrom , final Date dateTo , final Long clientId , final String status ) { } public Iterable < Payment > listPayments ( final Integer perPage , final Date dateFrom , final Date dateTo , final Long clientId ) { } public Iterable < Expense > listExpenses ( final Integer perPage , final Date dateFrom , final Date dateTo , final Long clientId , final Long categoryId , final Long projectId ) { } public Iterable < Client > listClients ( final Integer perPage , final String username , final String email ) { } public Iterable < Item > listItems ( final Integer perPage ) { } abstract class RecordsIterator < T > implements Iterator < T > { PagedResponseContent < T > current ; Iterator < T > currentIterator ; protected final Integer perPage ; protected final Date dateFrom ; protected final Date dateTo ; protected final Long clientId ; protected final String status ; protected final String username ; protected final String email ; protected final Long categoryId ; protected final Long projectId ; public RecordsIterator ( Integer perPage , Date dateFrom , Date dateTo , Long clientId , String status , String username , String email , Long categoryId , Long projectId ) throws ApiException , IOException { } protected abstract PagedResponseContent < T > list ( int page ) throws ApiException , IOException { } @ Override public boolean hasNext ( ) { } @ Override public T next ( ) { } @ Override public void remove ( ) { } } class InvoicesIterator extends ApiConnection . RecordsIterator < Invoice > { private InvoicesIterator ( Integer perPage , Date dateFrom , Date dateTo , Long clientId , String status ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Invoice > list ( int page ) throws ApiException , IOException { } } class PaymentsIterator extends ApiConnection . RecordsIterator < Payment > { private PaymentsIterator ( Integer perPage , Date dateFrom , Date dateTo , Long clientId ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Payment > list ( int page ) throws ApiException , IOException { } } class ExpensesIterator extends ApiConnection . RecordsIterator < Expense > { private ExpensesIterator ( Integer perPage , Date dateFrom , Date dateTo , Long clientId , Long categoryId , Long projectId ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Expense > list ( int page ) throws ApiException , IOException { } } class ClientsIterator extends ApiConnection . RecordsIterator < Client > { private ClientsIterator ( Integer perPage , String username , String email ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Client > list ( int page ) throws ApiException , IOException { } } class CallbacksIterator extends ApiConnection . RecordsIterator < Callback > { private CallbacksIterator ( Integer perPage ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Callback > list ( int page ) throws ApiException , IOException { } } class ItemsIterator extends ApiConnection . RecordsIterator < Item > { private ItemsIterator ( Integer perPage ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Item > list ( int page ) throws ApiException , IOException { } } class RecurringsIterator extends ApiConnection . RecordsIterator < Recurring > { private RecurringsIterator ( Integer perPage , Long clientId ) throws ApiException , IOException { } @ Override protected PagedResponseContent < Recurring > list ( int page ) throws ApiException , IOException { } } public Invoices listInvoices ( int page , Integer perPage , Date dateFrom , Date dateTo , Long clientId , String status ) throws ApiException , IOException { }

Fix:
if ( ( ( request . getRecurring ( ) . getLines ( ) ) == null ) || ( ( request . getRecurring ( ) . getLines ( ) . size ( ) ) == 0 ) ) {