### Question:
DefaultHandlerRegistry implements HandlerRegistry { public void addHandlers(Set<Object> handlers) { for (final Object handler : handlers) { Class<?> handlerType; Provider<?> handlerProvider; if (handler instanceof Class<?>) { handlerType = (Class<?>) handler; handlerProvider = injector.getProvider(handlerType); } else { handlerType = handler.getClass(); handlerProvider = new Provider<Object>() { public Object get() { return handler; } }; } Preconditions.checkState(handlerType.isAnnotationPresent(Service.class), "Attempt to bind unannotated service implementation %s",handlerType.getName()); Service service = handlerType.getAnnotation(Service.class); for (Method m : handlerType.getMethods()) { if (m.isAnnotationPresent(Operation.class)) { Operation op = m.getAnnotation(Operation.class); createRpcHandler(handlerProvider, service, op, m); createRestHandler(handlerProvider, service, op, m); } } } } @Inject  DefaultHandlerRegistry(Injector injector,
                                BeanJsonConverter beanJsonConverter,
                                HandlerExecutionListener executionListener); void addHandlers(Set<Object> handlers); RpcHandler getRpcHandler(JSONObject rpc); RestHandler getRestHandler(String path, String method); Set<String> getSupportedRestServices(); Set<String> getSupportedRpcServices();  }### Answer:
@Test(expected = IllegalStateException.class) public void testAddNonService() { registry.addHandlers(Sets.newHashSet(new Object())); }