May I suggest looking at this situation in a different way?
The net result here was that, eight minutes after having posted your question, you got a well-written answer to it, which is now available for everyone else through the target question. I'd say that's a good ending!
Perhaps you are bothered or offended by having your question closed as a duplicate. Please don't. There is no shame in occasionally posting duplicate questions: non-obvious duplicates serve as signposts for searchers. In fact, if you really think the fact that you mention the WS-RS library might make it easier to find the answer, I encourage you to undelete your question -- it will be useful for that purpose even if it is closed.
As for your other concerns:
On the behaviour of the answerer: I don't see anything underhanded. He closed your question in ~5 minutes, and added the extra section about three minutes after that. The edit happened only 50 seconds after your "not a duplicate" comment (which, by the way, was promptly replied to pointing out the added content, in case you had seen that question before the edit), so we can't even be cynical and say the answerer was trying to cover the tracks of the duplicate closure.
On whether your question is a duplicate: while you do have an extra restriction to deal with ("I am using a library, hence it is not in my control of what types of parameters library accepts"), the target question doesn't explicitly rule out this scenario (i.e. in spite of the minimal example there, it doesn't explicitly state "assume I can change the interface at will"). That being so, and considering we are talking about a minor variation on the same theme, editing the target answer to make it more general is perfectly okay. At the end of the day, the test for a duplicate is: can a single answer reasonably cover both questions? And that is precisely what we see here.
On appending the answer to your question to a long post: I'd say the answer is not long enough for that to be a problem. Note, though, that Shepmaster did try to address your concerns on this matter with a further edit, that brought the new section closer to the beginning.