Java in this case is much more strict. So the short answer is no, Java does not have Expando. The syntax just does not support this.
However, Groovy has Expando, which is a dynamic language on top of java.
By the way, if you use Expando for testing, there are many different solutions related to Mock: EasyMock, Mockito, JMock, to name a few.
Hope this helps
source share