Non-void test methods in JUnit 4
问题 I would like a JUnit 4 test class to implement the same interface as the class its testing. This way, as the interface changes (and it will, we're in early development), the compiler guarantees that corresponding methods are added to the test class. For example: public interface Service { public String getFoo(); public String getBar(); } public class ServiceImpl implements Service { @Override public String getFoo() { return "FOO"; } @Override public String getBar() { return "BAR"; } } public