Converting long list of if/else
I would assume that Company has e setter method signature as setEmployees(List employees) or setEmployees(Arraylist employees) or some ? wildcard setter, since it accepts as parameter List&lt;Employee&gt; and List&lt;Contractor&gt;. 

I would also assume that Employee and Contractor extend one another or the same super class.

In that case, I don't see the benefit of creating such a custom generic setter. Instead I would use the same setter, and mitigate the type identification in the parsing method: company.setEmployees(parseFromReader(currentToken, reader))
and have the List&lt;Employee&gt; parseFromReader(currentToken, reader) worry about the specific instance type, since I assume also most of the information to be parsed would be the same (if the classes extend the same super class).