/** * Verifies that Annotations created by merging {@code annotations} is equal to actual * Annotations. * * @param actual Annotations to check * @param annotations */ private static void assertAnnotationsEquals( Annotations actual, SparseAnnotations... annotations) { SparseAnnotations expected = DefaultAnnotations.builder().build(); for (SparseAnnotations a : annotations) { expected = DefaultAnnotations.union(expected, a); } assertEquals(expected.keys(), actual.keys()); for (String key : expected.keys()) { assertEquals(expected.value(key), actual.value(key)); } }