### Question:
FeatureJsonParser { @SuppressWarnings("unchecked") public static FlippingStrategy parseFlipStrategyAsJson(String uid, String json) { if (null == json || "".equals(json)) { return null; } try { return parseFlipStrategy(uid, (HashMap<String, Object>) objectMapper.readValue(json, HashMap.class)); } catch (Exception e) { throw new IllegalArgumentException("Cannot parse JSON " + json, e); } } private  FeatureJsonParser(); @SuppressWarnings("unchecked") static Feature parseFeature(String json); @SuppressWarnings("unchecked") static Set<String> parsePermissions(String json); static String featureArrayToJson(Feature[] features); @SuppressWarnings("unchecked") static FlippingStrategy parseFlipStrategyAsJson(String uid, String json); @SuppressWarnings("unchecked") static FlippingStrategy parseFlipStrategy(String uid, Map<String, Object> flipMap); @SuppressWarnings("unchecked") static Feature[] parseFeatureArray(String json);  }### Answer:
@Test public void testParseFlipStrategyAsJson() { Assert.assertNull(FeatureJsonParser.parseFlipStrategyAsJson("f1", "")); Assert.assertNull(FeatureJsonParser.parseFlipStrategyAsJson("f1", null)); String fExp = "{\"initParams\":{\"weight\":\"0.6\"},\"type\":\"org.ff4j.strategy.PonderationStrategy\"}"; Assert.assertNotNull(FeatureJsonParser.parseFlipStrategyAsJson("f1", fExp)); }
@Test(expected = IllegalArgumentException.class) public void testParseFlipStrategyAsJsonError() { FeatureJsonParser.parseFlipStrategyAsJson("f1", "something:invalid"); }