@Test
    public void create_network_pdu_segmented_isCorrect() {
        //Message #6

        final Map<Integer, String> expectedNetworkPdu = new HashMap<>();
        expectedNetworkPdu.put(0, "0068cab5c5348a230afba8c63d4e686364979deaf4fd40961145939cda0e".toUpperCase(Locale.US));
        expectedNetworkPdu.put(1, "00681615b5dd4a846cae0c032bf0746f44f1b8cc8ce5edc57e55beed49c0".toUpperCase(Locale.US));

        final byte[] netkey = MeshParserUtils.toByteArray("7dd7364cd842ad18c17c2b820c84c3d6");

        final int ttl = 0x04;
        final byte[] sequenceNumber = MeshParserUtils.toByteArray("3129ab");
        final int src = 0x0003;
        final int dst = 0x1201;

        final byte[] lowerTransportPdu0 = MeshParserUtils.toByteArray("8026ac01ee9dddfd2169326d23f3afdf".toUpperCase(Locale.US));
        final byte[] lowerTransportPdu1 = MeshParserUtils.toByteArray("8026ac21cfdc18c52fdef772e0e17308".toUpperCase(Locale.US));
        final byte[] ivIndex = MeshParserUtils.toByteArray("12345678");

        final SecureUtils.K2Output k2Output = SecureUtils.calculateK2(netkey, SecureUtils.K2_MASTER_INPUT);
        final ProvisionedMeshNode meshNode = new ProvisionedMeshNode();

        final MeshTransport meshLayerTestBase = new MeshTransport(context, meshNode);
        final AccessMessage accessMessage = new AccessMessage();
        accessMessage.setTtl(ttl);
        accessMessage.setSrc(src);
        accessMessage.setDst(dst);
        accessMessage.setSequenceNumber(sequenceNumber);
        accessMessage.setIvIndex(ivIndex);
        final SparseArray<byte[]> lowerTransportAccessPdu = new SparseArray<>();
        lowerTransportAccessPdu.put(0, lowerTransportPdu0);
        lowerTransportAccessPdu.put(1, lowerTransportPdu1);
        accessMessage.setLowerTransportAccessPdu(lowerTransportAccessPdu);

        final Message message = meshLayerTestBase.createNetworkLayerPDU(accessMessage);

        final SparseArray<byte[]> actualNetworkTransportPdu = message.getNetworkLayerPdu();

        Assert.assertFalse("Segment count does not match", expectedNetworkPdu.size() != actualNetworkTransportPdu.size());

        if (expectedNetworkPdu.size() == actualNetworkTransportPdu.size()) {
            final int size = actualNetworkTransportPdu.size();
            for (int i = 0; i < size; i++) {
                final byte[] actualTransportPDU = actualNetworkTransportPdu.get(i);
                assertEquals(expectedNetworkPdu.get(i), MeshParserUtils.bytesToHex(actualTransportPDU, 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/NetworkLayerTests.java