### Question:
HostsValidator implements ResourceValidator<Hosts> { @Override public ValidatorResult validate(Hosts hosts, Object ctx) { ValidatorResult result = validator.validate(hosts, ctx); return ValidatorUtilities.removeEmptyMessages(result); } HostsValidator(); @Override ValidatorResult validate(Hosts hosts, Object ctx); @Override Validator<Hosts> getValidator();  }### Answer:
@Test public void shouldRejectEmptyHostsListOnPut() { res = hv.validate(hs,PUT); assertFalse(resultMessage(res,PUT),res.passedValidation()); }
@Test public void shouldAcceptSingleHostOnPut() { h = new Host(); h.setName("Blah"); hs.getHosts().add(h); res = hv.validate(hs,PUT); assertTrue(resultMessage(res,PUT),res.passedValidation()); }
@Test public void shouldAcceptMultiHostPut() { hs.getHosts().add(StubFactory.rndHostPut()); hs.getHosts().add(StubFactory.rndHostPut()); res = hv.validate(hs,PUT); assertTrue(resultMessage(res,PUT),res.passedValidation()); }