I tried an approach without using HashMaps. Can anyone tell me if the code is doing what I think it's doing? The idea was to find the frequency of most frequent and then loop through the byte array again. In the new loop I'm adding to a new ArrayList <byte> all the items with max frequency. Thanks!