### Question:
YoutubeEventClassifier { public static Class detectClass(String json) { Objects.requireNonNull(json); Preconditions.checkArgument(StringUtils.isNotEmpty(json)); ObjectNode objectNode; try { objectNode = (ObjectNode) mapper.readTree(json); } catch (IOException ex) { ex.printStackTrace(); return null; } if (objectNode.findValue("kind") != null && objectNode.get("kind").toString().equals(VIDEO_IDENTIFIER)) { return Video.class; } else if (objectNode.findValue("kind") != null && objectNode.get("kind").toString().contains(CHANNEL_IDENTIFIER)) { return com.google.api.services.youtube.model.Channel.class; } else { return ObjectNode.class; } }  static Class detectClass(String json);  }### Answer:
@Test public void testVideoClassification() { Class klass = YoutubeEventClassifier.detectClass(testVideo); assertEquals(klass, Video.class); }
@Test(expected = IllegalArgumentException.class) public void testExceptionClassification() { YoutubeEventClassifier.detectClass(""); }
@Test public void testObjectNodeClassification() { Class klass = YoutubeEventClassifier.detectClass(testObjectNode); assertEquals(klass, ObjectNode.class); }