Either use dynamic proxies (google is your friend) which will allow you to generate a class at runtime which implements any interface(s) you need, or, if it's for actual testing (rather than just trying stuff out) you might be interested in a mock objects framework, such as EasyMock. On the subject of dynamic proxies, libraries like CGLIB and ASM will allow ...