What's a suitable return type for this Java method?
<p>we are implementing a system with Strategy pattern. </p>

<p>Some callers to a specific methods require a Hashmap of data while in some case it would be a user-defined DTO. Some need both.</p>

<p>How do we decide which return type to use, instead of an Arraylist containing Hashmap and DTO ? Is there anything more approporiate? </p>

<p>Example:</p>

<p>Some caller needs only 2 strings and prefers a Hashmap.</p>

<p>Some other caller to the same API needs 12 values which are suited to put in a DTO. 1st caller does not need all the elements in the DTO.</p>

<p>3rd caller needs all 14 values and hence both structures.</p>
