### Question:
SshFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } SshFeed(); protected  SshFeed(final Builder builder); static Builder builder(); @Deprecated static SshMachineLocation getMachineOfEntity(Entity entity); static final Logger log; @SuppressWarnings("serial")
    static final ConfigKey<Supplier<SshMachineLocation>> MACHINE; static final ConfigKey<Boolean> EXEC_AS_COMMAND; @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<SshPollIdentifier, SshPollConfig<?>>> POLLS; }### Answer:
@Test(groups="Integration") public void testSharesCallWhenSameCommand() throws Exception { final RecordingSshMachineLocation recordingMachine = mgmt.getLocationManager().createLocation(LocationSpec.create(RecordingSshMachineLocation.class)); app.start(ImmutableList.of(recordingMachine)); final String cmd = "myCommand"; feed = SshFeed.builder() .period(Duration.PRACTICALLY_FOREVER) .entity(entity) .poll(new SshPollConfig<String>(SENSOR_STRING) .env(ImmutableMap.of("mykey", "myval")) .command(cmd) .onSuccess(Functions.constant("success"))) .poll(new SshPollConfig<String>(SENSOR_STRING2) .env(ImmutableMap.of("mykey", "myval")) .command(cmd) .onSuccess(Functions.constant("success2"))) .build(); Asserts.succeedsEventually(new Runnable() { public void run() { assertEquals(RecordingSshMachineLocation.execScriptCalls, ImmutableList.of(ImmutableList.of(cmd))); }}); Asserts.succeedsContinually(ImmutableMap.of("timeout", Duration.FIVE_SECONDS), new Runnable() { public void run() { assertEquals(RecordingSshMachineLocation.execScriptCalls, ImmutableList.of(ImmutableList.of(cmd))); }}); }
@Test public void testDifferentCallsWhenDifferentCommands() throws Exception { final RecordingSshMachineLocation recordingMachine = mgmt.getLocationManager().createLocation(LocationSpec.create(RecordingSshMachineLocation.class)); app.start(ImmutableList.of(recordingMachine)); final String cmd = "myCommand"; final String cmd2 = "myCommand2"; feed = SshFeed.builder() .period(Duration.PRACTICALLY_FOREVER) .entity(entity) .poll(new SshPollConfig<String>(SENSOR_STRING) .command(cmd) .onSuccess(Functions.constant("success"))) .poll(new SshPollConfig<String>(SENSOR_STRING2) .command(cmd2) .onSuccess(Functions.constant("success"))) .build(); Asserts.succeedsEventually(new Runnable() { public void run() { assertEquals(ImmutableSet.copyOf(RecordingSshMachineLocation.execScriptCalls), ImmutableSet.of(ImmutableList.of(cmd), ImmutableList.of(cmd2))); }}); }
@Test public void testDifferentCallsWhenDifferentEnv() throws Exception { final RecordingSshMachineLocation recordingMachine = mgmt.getLocationManager().createLocation(LocationSpec.create(RecordingSshMachineLocation.class)); app.start(ImmutableList.of(recordingMachine)); final String cmd = "myCommand"; feed = SshFeed.builder() .period(Duration.PRACTICALLY_FOREVER) .entity(entity) .poll(new SshPollConfig<String>(SENSOR_STRING) .env(ImmutableMap.of("mykey", "myval")) .command(cmd) .onSuccess(Functions.constant("success"))) .poll(new SshPollConfig<String>(SENSOR_STRING2) .env(ImmutableMap.of("mykey", "myval2")) .command(cmd) .onSuccess(Functions.constant("success"))) .build(); Asserts.succeedsEventually(new Runnable() { public void run() { assertEquals(RecordingSshMachineLocation.execScriptCalls, ImmutableList.of(ImmutableList.of(cmd), ImmutableList.of(cmd))); }}); }