RegisterImageOptions extends BaseEC2RequestOptions { public RegisterImageOptions withKernelId(String kernelId) { formParameters.put("KernelId", checkNotNull(kernelId, "kernelId")); return this; }  RegisterImageOptions asArchitecture(Architecture architecture); RegisterImageOptions withDescription(String info); RegisterImageOptions withKernelId(String kernelId); RegisterImageOptions withRamdisk(String ramDiskId);  }
@Test public void testWithKernelId() { RegisterImageOptions options = new RegisterImageOptions(); options.withKernelId("test"); assertEquals(options.buildFormParameters().get("KernelId"), ImmutableList.of("test")); }
@Test public void testWithKernelIdStatic() { RegisterImageOptions options = withKernelId("test"); assertEquals(options.buildFormParameters().get("KernelId"), ImmutableList.of("test")); }
@Test(expectedExceptions = NullPointerException.class) public void testWithKernelIdNPE() { withKernelId(null); }