Annotation[] ann1 = m1.getAnnotations();
assertEquals(1, ann1.length);
Annotation[] ann2 = m2.getAnnotations();
assertEquals(1, ann2.length);
AnnotationBundleKey key1 = new AnnotationBundleKey(ann1, Object.class);
AnnotationBundleKey key2 = new AnnotationBundleKey(ann2, Object.class);
AnnotationBundleKey key1dup = new AnnotationBundleKey(ann1, Object.class);
AnnotationBundleKey key1immutable = key1.immutableKey();
// identity checks first
assertEquals(key1, key1);
assertEquals(key2, key2);
assertEquals(key1dup, key1dup);
assertEquals(key1immutable, key1immutable);
assertEquals(key1.hashCode(), key1dup.hashCode());
// then inequality by content (even though both have 1 JSONP annotation)
assertFalse(key1.equals(key2));
assertFalse(key2.equals(key1));
// but safe copy ought to be equal
assertTrue(key1.equals(key1dup)); // from same method
assertTrue(key1dup.equals(key1));
assertTrue(key1.equals(key1immutable)); // and immutable variant
assertTrue(key1immutable.equals(key1));
}