### Question:
DataProxy { protected static String map1stMatchingTagNames(SpanPack pack, String tagNames) { if (StringUtil.isEmpty(tagNames)) { return null; } return Arrays.stream(tagNames.split(",")) .map(tag -> pack.tags.getText(tag)) .filter(StringUtil::isNotEmpty) .findFirst().orElse(null); }  static int sendSqlText(String sql); static int sendServiceName(String service); static void sendServiceName(int hash, String service); static int sendDesc(String desc); static int sendLogin(String loginName); static void registerZipkinObj(Span span, ScouterConfig conf); static void sendHeartBeat(ObjectPack p); static int sendObjName(String objName); static void sendObjName(int hash, String objName); static int sendError(String message); static int sendHashedMessage(String text); static void reset(); static void sendXLog(XLogPack p); static void sendDirect(Pack p); static void sendSpanContainer(final List<Span> spans, final ScouterConfig conf); static XLogPack makeXLogPack(SpanPack pack, ScouterConfig conf);  }### Answer:
@Test public void map1stMatchingTagNames_no_matching() { assertNull(DataProxy.map1stMatchingTagNames(pack, "tagX")); assertNull(DataProxy.map1stMatchingTagNames(pack, "tagY")); assertNull(DataProxy.map1stMatchingTagNames(pack, "tagX,tagY")); }
@Test public void map1stMatchingTagNames_matching() { assertThat(DataProxy.map1stMatchingTagNames(pack, "tag1"), is(pack.tags.getText("tag1"))); assertThat(DataProxy.map1stMatchingTagNames(pack, "tag2"), is(pack.tags.getText("tag2"))); assertThat(DataProxy.map1stMatchingTagNames(pack, "tag1,tag2"), is(pack.tags.getText("tag1"))); assertThat(DataProxy.map1stMatchingTagNames(pack, "tag2,tag1"), is(pack.tags.getText("tag2"))); assertThat(DataProxy.map1stMatchingTagNames(pack, "tagX,tag1"), is(pack.tags.getText("tag1"))); assertThat(DataProxy.map1stMatchingTagNames(pack, "tagX,tag2,tag3"), is(pack.tags.getText("tag2"))); }