RegisterImageOptions extends BaseEC2RequestOptions { public RegisterImageOptions asArchitecture(Architecture architecture) { formParameters.put("Architecture", checkNotNull(architecture, "architecture").value()); return this; }  RegisterImageOptions asArchitecture(Architecture architecture); RegisterImageOptions withDescription(String info); RegisterImageOptions withKernelId(String kernelId); RegisterImageOptions withRamdisk(String ramDiskId);  }
@Test public void testWithArchitecture() { RegisterImageOptions options = new RegisterImageOptions(); options.asArchitecture(Architecture.I386); assertEquals(options.buildFormParameters().get("Architecture"), ImmutableList.of("i386")); }
@Test public void testWithArchitectureStatic() { RegisterImageOptions options = asArchitecture(Architecture.I386); assertEquals(options.buildFormParameters().get("Architecture"), ImmutableList.of("i386")); }
@Test(expectedExceptions = NullPointerException.class) public void testWithArchitectureNPE() { asArchitecture(null); }