@Test
    public void create_custom_access_message_isCorrect() {
        //Message 21

        final String expectedAccessMessage = "d50a0048656c6c6f".toUpperCase(Locale.US);

        final int opCode = 0x15;
        final int companyIdentifier = 0x000A;
        final byte[] parameters = MeshParserUtils.toByteArray("48656c6c6f");

        final ProvisionedMeshNode meshNode = new ProvisionedMeshNode();

        final AccessMessage accessMessage = new AccessMessage();
        accessMessage.setOpCode(opCode);
        accessMessage.setParameters(parameters);
        accessMessage.setCompanyIdentifier(companyIdentifier);
        accessMessage.setParameters(parameters);
        final MeshTransport meshTransport = new MeshTransport(context, meshNode);
        meshTransport.createCustomAccessMessage(accessMessage);
        final byte[] actualAccessMessage = accessMessage.getAccessPdu();
        assertEquals(expectedAccessMessage, MeshParserUtils.bytesToHex(actualAccessMessage, false));
    }
Example local unit test, which will execute on the development machine (host).

@see <a href="http://d.android.com/tools/testing">Testing documentation</a>
mesh/src/test/java/no/nordicsemi/android/mesh/transport/AccessLayerTests.java