### Question:
HealthCheck extends Descriptor { public static ExecHealthCheck.Builder newExecHealthCheck() { return ExecHealthCheck.newBuilder(); } HealthCheck(final String type); String getType(); static ExecHealthCheck.Builder newExecHealthCheck(); static HttpHealthCheck.Builder newHttpHealthCheck(); static TcpHealthCheck.Builder newTcpHealthCheck(); @Override String toString(); static final String EXEC; static final String HTTP; static final String TCP; }### Answer:
@Test public void testExecHealthCheckBuilder() { final ExecHealthCheck healthCheck = HealthCheck.newExecHealthCheck() .setCommand(Collections.singletonList("whoami")).build(); assertEquals("cmd", healthCheck.getCommand(), ImmutableList.of("whoami")); }
@Test(expected = IllegalArgumentException.class) public void testExecWithoutCmd() { HealthCheck.newExecHealthCheck().build(); }