We should pass the ClassGenerator instance value (instead of the boolean returned by instanceof) to the setClass method call. Added testCreateFromArrayWithClassInstance which directly addresses issue 4006, also added testCreateFromArrayWithClassFromArray since it was not there
Merge branch 'hotfix/4005'

Close #4005
Merge pull request #4007 from righter/hotfix/4006

Pass ClassGenerator instance instead of boolean
Merge branch 'hotfix/4007' into develop

Forward port #4007