    @Test
    public void shouldBridgeMetadata() throws Exception {

        final HashMap<String, Object> user = Maps.newHashMap();
        user.put("first_name", "John");
        user.put("last_name", "Doe");
        user.put("friend_count", 14);

        final HashMap<String, Object> app = Maps.newHashMap();
        app.put("subscription", "bronze");

        final UserProfile profile = withMetadata(INFO_AUTH0_COM, user, app);
        final ReadableMap map = bridge(profile);

        assertThat(map.getString(EMAIL), equalTo(INFO_AUTH0_COM));

        final ReadableMap userMetadata = map.getMap(USER_METADATA);
        assertThat(userMetadata.getString("first_name"), equalTo("John"));
        assertThat(userMetadata.getString("last_name"), equalTo("Doe"));
        assertThat(userMetadata.getInt("friend_count"), equalTo(14));

        final ReadableMap appMetadata = map.getMap(APP_METADATA);
        assertThat(appMetadata.getString("subscription"), equalTo("bronze"));
    }