RxViper { static void checkNoPublicGetters(Class<?> clazz) { final Method[] methods = clazz.getMethods(); for (Method m : methods) { final Class<?> type = m.getReturnType(); check(type == Void.TYPE, format("Method %s must be void, but returns %s.", m.getName(), type.getSimpleName())); } } private  RxViper();   }
@Test public void shouldNotHaveGetters() { RxViper.checkNoPublicGetters(IDontHaveGetters.class); }
@Test public void shouldThrowIfHasGetter() { thrown.expect(IllegalStateException.class); thrown.expectMessage("Method getObject must be void, but returns Object."); RxViper.checkNoPublicGetters(IHaveGetter.class); }
@Test public void shouldThrowIfInheritedGetter() { thrown.expect(IllegalStateException.class); thrown.expectMessage("Method getObject must be void, but returns Object."); RxViper.checkNoPublicGetters(IHaveInheritedGetter.class); }