public void assertEmbedded(String input, String tensorType, Integer... expectedCodes) {
        TensorType type = TensorType.fromSpec(tensorType);
        assertEquals(1, type.dimensions().size());
        assertTrue(type.dimensions().get(0).isIndexed());

        int tensorSize = type.dimensions().get(0).size().get().intValue();

        assertArrayEquals(expectedCodes, embedder.embed(input, new Embedder.Context("test")).toArray());

        var builder = Tensor.Builder.of(type);
        for (int i = 0; i < tensorSize; i++)
            builder.cell(i < expectedCodes.length ? expectedCodes[i] : 0, i);
        assertEquals(builder.build(), embedder.embed(input, new Embedder.Context("destination"), type));
    }
Tests both embedding to a list of id's and encoding the same ids to a vector of the given type.

@param expectedCodes all the expected codes of the given input, not including any trailing 0-paddings
                     required for the tensor only
linguistics-components/src/test/java/com/yahoo/language/tools/EmbedderTester.java