class Helper {

    public void validate(List<VersionModule> modules) {
        if (modules == null || modules.isEmpty()) {
            throw new IllegalArgumentException("No modules found.");
        }
        for (VersionModule module : modules) {
            if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) {
                throw new IllegalArgumentException("No annotated method found.");
            }
        }
    }

}

class HelperTest {

    private Helper mHelper;

    @Test(expected = IllegalArgumentException.class)
    public void validationFailure_null() throws Exception {

        mHelper.validate(null);
    }

}