### Question:
CreateVolumeOptions extends BaseEC2RequestOptions { public CreateVolumeOptions fromSnapshotId(String snapshotId) { formParameters.put("SnapshotId", checkNotNull(snapshotId, "snapshotId")); return this; }  CreateVolumeOptions withSize(int size); int getSize(); CreateVolumeOptions fromSnapshotId(String snapshotId); String getSnapshotId(); CreateVolumeOptions volumeType(String volumeType); String getVolumeType(); CreateVolumeOptions withIops(Integer iops); Integer getIops(); CreateVolumeOptions isEncrypted(boolean encrypted); boolean getEncrypted();  }### Answer:
@Test public void testFromSnapshotId() { CreateVolumeOptions options = new CreateVolumeOptions(); options.fromSnapshotId("test"); assertEquals(options.buildFormParameters().get("SnapshotId"), ImmutableList.of("test")); }
@Test public void testWithSnapshotIdStatic() { CreateVolumeOptions options = fromSnapshotId("test"); assertEquals(options.buildFormParameters().get("SnapshotId"), ImmutableList.of("test")); }
@Test(expectedExceptions = NullPointerException.class) public void testFromSnapshotIdNPE() { fromSnapshotId(null); }