### Question:
MetadataRepo { @RestrictTo(LIBRARY_GROUP) @VisibleForTesting void put(@NonNull final EmojiMetadata data) { Preconditions.checkNotNull(data, "emoji metadata cannot be null"); Preconditions.checkArgument(data.getCodepointsLength() > 0, "invalid metadata codepoint length"); mRootNode.put(data, 0, data.getCodepointsLength() - 1); } @RestrictTo(LIBRARY_GROUP)  MetadataRepo(); private  MetadataRepo(@NonNull final Typeface typeface,
            @NonNull final MetadataList metadataList); static MetadataRepo create(@NonNull final Typeface typeface,
            @NonNull final InputStream inputStream); static MetadataRepo create(@NonNull final Typeface typeface,
            @NonNull final ByteBuffer byteBuffer); static MetadataRepo create(@NonNull final AssetManager assetManager,
            final String assetPath); @RestrictTo(LIBRARY_GROUP) char[] getEmojiCharArray(); @RestrictTo(LIBRARY_GROUP) MetadataList getMetadataList();  }### Answer:
@Test(expected = NullPointerException.class) public void testPut_withNullMetadata() { mMetadataRepo.put(null); }
@Test(expected = IllegalArgumentException.class) public void testPut_withEmptyKeys() { mMetadataRepo.put(new TestEmojiMetadata(new int[0])); }
@Test public void testPut_withSingleCodePointMapping() { final int[] codePoint = new int[]{1}; final TestEmojiMetadata metadata = new TestEmojiMetadata(codePoint); mMetadataRepo.put(metadata); assertSame(metadata, getNode(codePoint)); }
@Test public void testPut_withMultiCodePointsMapping() { final int[] codePoint = new int[]{1, 2, 3, 4}; final TestEmojiMetadata metadata = new TestEmojiMetadata(codePoint); mMetadataRepo.put(metadata); assertSame(metadata, getNode(codePoint)); assertEquals(null, getNode(new int[]{1})); assertEquals(null, getNode(new int[]{1, 2})); assertEquals(null, getNode(new int[]{1, 2, 3})); assertEquals(null, getNode(new int[]{1, 2, 3, 5})); }
@Test public void testPut_sequentialCodePoints() { final int[] codePoint1 = new int[]{1, 2, 3, 4}; final EmojiMetadata metadata1 = new TestEmojiMetadata(codePoint1); final int[] codePoint2 = new int[]{1, 2, 3}; final EmojiMetadata metadata2 = new TestEmojiMetadata(codePoint2); final int[] codePoint3 = new int[]{1, 2}; final EmojiMetadata metadata3 = new TestEmojiMetadata(codePoint3); mMetadataRepo.put(metadata1); mMetadataRepo.put(metadata2); mMetadataRepo.put(metadata3); assertSame(metadata1, getNode(codePoint1)); assertSame(metadata2, getNode(codePoint2)); assertSame(metadata3, getNode(codePoint3)); assertEquals(null, getNode(new int[]{1})); assertEquals(null, getNode(new int[]{1, 2, 3, 4, 5})); }