DetachVolumeOptions extends BaseEC2RequestOptions { public DetachVolumeOptions fromInstance(String instanceId) { formParameters.put("InstanceId", checkNotNull(instanceId, "instanceId")); return this; }  DetachVolumeOptions fromInstance(String instanceId); String getInstance(); DetachVolumeOptions fromDevice(String device); String getDevice();  }
@Test public void testFromInstance() { DetachVolumeOptions options = new DetachVolumeOptions(); options.fromInstance("test"); assertEquals(options.buildFormParameters().get("InstanceId"), ImmutableList.of("test")); }
@Test public void testFromInstanceStatic() { DetachVolumeOptions options = fromInstance("test"); assertEquals(options.buildFormParameters().get("InstanceId"), ImmutableList.of("test")); }
@Test(expectedExceptions = NullPointerException.class) public void testFromInstanceNPE() { fromInstance(null); }