Merging two array of classes
Staying with your original code you can change b to a simple break and you can change the inner while to a for which is easier to read:

public Asset[] merge2(final Asset[] firstArray, final ArrayList&lt;CountR&gt; secondList) {
    while (secondList.size() != 0) {
        for (int i = 0; i &lt; firstArray.length; i++) {
            final CountR countR = secondList.get(0);
            final Asset asset = firstArray[i];
            if (countR.id.equals(asset.id)) {
                asset.TotaleRegistrazioni = countR.tot;
                break;
            }
        }
        secondList.remove(0);
    }
    return firstArray;
}


Searching in a HashMap should be faster than iterating through the whole array, so I'd do the following:

public Asset[] merge3(final Asset[] firstArray, final CountR[] secondArray) {
    final Map&lt;Id, Asset&gt; assetCache = new HashMap&lt;Id, Asset&gt;();
    for (final Asset asset : firstArray) {
        final Id id = asset.getId();
        assetCache.put(id, asset);
    }

    for (final CountR countR : secondArray) {
        final Id countRId = countR.getId();
        final Asset asset = assetCache.get(countRId);
        if (asset != null) {
            // I supposed that it's int
            final int total = countR.getTot();
            asset.setTotaleRegistrazioni(total); 
        }
    }

    return firstArray;
}


(I supposed that the Asset.id is unique in the array.) In this case you don't have to convert the second parameter to an array (just the first to a map). Maybe it worth playing with the initialCapacity and loadFactor parameters of the HashMap to avoid the resizing.