private void assertNoSuchKeyExceptionThrown( ReadableMap map, String key, String typeToAskFor) { boolean gotException = false; try { mapGetByType(map, key, typeToAskFor); } catch (NoSuchKeyException expected) { gotException = true; } assertTrue(gotException); }
public static String tryGetString(ReadableMap map, String key) { try { return map.getString(key); } catch (NoSuchKeyException e) { return null; } }