Structs { public static Boolean getBoolean(Map<String, Object> map, String name) { return getValue(map, name, Boolean.class, "a boolean"); } private  Structs(); static String getString(Map<String, Object> map, String name); static String getString(
      Map<String, Object> map, String name, @Nullable String defaultValue); static byte[] getBytes(Map<String, Object> map, String name); static byte @Nullable [] getBytes(
      Map<String, Object> map, String name, byte @Nullable [] defaultValue); static Boolean getBoolean(Map<String, Object> map, String name); static @Nullable Boolean getBoolean(
      Map<String, Object> map, String name, @Nullable Boolean defaultValue); static Long getLong(Map<String, Object> map, String name); static @Nullable Long getLong(
      Map<String, Object> map, String name, @Nullable Long defaultValue); static Integer getInt(Map<String, Object> map, String name); static @Nullable Integer getInt(
      Map<String, Object> map, String name, @Nullable Integer defaultValue); static @Nullable List<String> getStrings(
      Map<String, Object> map, String name, @Nullable List<String> defaultValue); static Map<String, Object> getObject(Map<String, Object> map, String name); static @Nullable Map<String, Object> getObject(
      Map<String, Object> map, String name, @Nullable Map<String, Object> defaultValue); static @Nullable List<Map<String, Object>> getListOfMaps(
      Map<String, Object> map, String name, @Nullable List<Map<String, Object>> defaultValue); static Map<String, Object> getDictionary(Map<String, Object> map, String name); static @Nullable Map<String, Object> getDictionary(
      Map<String, Object> map, String name, @Nullable Map<String, Object> defaultValue); static void addString(Map<String, Object> map, String name, String value); static void addBoolean(Map<String, Object> map, String name, boolean value); static void addLong(Map<String, Object> map, String name, long value); static void addObject(Map<String, Object> map, String name, Map<String, Object> value); static void addNull(Map<String, Object> map, String name); static void addLongs(Map<String, Object> map, String name, long... longs); static void addList(
      Map<String, Object> map, String name, List<? extends Map<String, Object>> elements); static void addStringList(Map<String, Object> map, String name, List<String> elements); static void addList(
      Map<String, Object> map, String name, T[] elements); static void addDictionary(
      Map<String, Object> map, String name, Map<String, Object> value); static void addDouble(Map<String, Object> map, String name, Double value);  }
@Test public void testGetBooleanParameter() throws Exception { Map<String, Object> o = makeCloudDictionary(); Assert.assertTrue(getBoolean(o, "singletonBooleanKey", false)); Assert.assertFalse(getBoolean(o, "missingKey", false)); try { getBoolean(o, "emptyKey", false); Assert.fail("should have thrown an exception"); } catch (Exception exn) { Assert.assertThat(exn.toString(), Matchers.containsString("not a boolean")); } }