### Question:
Utils { public static Measurement first(Iterable<Measurement> ms, Tag t) { return first(ms, t.key(), t.value()); } private  Utils(); static Id normalize(Id id); static String getTagValue(Id id, String k); static String getTagValue(Iterable<Tag> tags, String k); static T getValue(Iterable<T> values, int pos); static Measurement first(Iterable<Measurement> ms, Tag t); static Measurement first(final Iterable<Measurement> ms, final String k, final String v); static Measurement first(Iterable<Measurement> ms, Predicate<Measurement> p); static Iterable<Measurement> filter(Iterable<Measurement> ms, Tag t); static Iterable<Measurement> filter(
      final Iterable<Measurement> ms, final String k, final String v); static Iterable<Measurement> filter(
      final Iterable<Measurement> ms, final Predicate<Measurement> p); static List<T> toList(Iterable<T> iter); static List<T> toList(Iterator<T> iter); @SuppressWarnings("PMD.UnusedLocalVariable") static int size(Iterable<T> iter); static V computeIfAbsent(ConcurrentMap<K, V> map, K k, Function<K, V> f); static void propagateTypeError(
      Registry registry, Id id, Class<?> desiredClass, Class<?> actualClass);  }### Answer:
@Test public void firstTag() { List<Measurement> ms = newList(10); Tag t = new BasicTag("i", "7"); Measurement m = Utils.first(ms, t); Assertions.assertEquals(m.id().tags(), ArrayTagSet.create(t)); }
@Test public void firstKV() { List<Measurement> ms = newList(10); Tag t = new BasicTag("i", "7"); Measurement m = Utils.first(ms, "i", "7"); Assertions.assertEquals(m.id().tags(), ArrayTagSet.create(t)); }
@Test public void firstPredicate() { List<Measurement> ms = newList(10); Tag t = new BasicTag("i", "7"); Measurement m = Utils.first(ms, v -> v.value() == 7.0); Assertions.assertEquals(m.id().tags(), ArrayTagSet.create(t)); }
@Test public void firstPredicateEmpty() { List<Measurement> ms = newList(10); Measurement m = Utils.first(ms, v -> false); Assertions.assertNull(m); }