List result = new ArrayList( list.size() );
Set distinct = new HashSet();
for ( int i=0; i<list.size(); i++ ) {
Object entity = list.get(i);
if ( distinct.add( new Identity(entity) ) ) {
result.add(entity);
}
}
if ( log.isDebugEnabled() ) log.debug(
"transformed: " +
list.size() + " rows to: " +
result.size() + " distinct results"
);
return result;