Parsing GSM 7-Bit messages in Java
thing I really don't like is my counter variable that I reset at 7


may be just keep incrementing the counter as counter = (counter + 1) % 8 instead of keeping it in the for loop. 


  Any advice on how to improve this code?


this may be just me, but bit operations are very mysterious so I'd like to have a variable for 0x7F &amp; 0xFF to understand what's to special

Also, I'm not really sure why counter == 6 leads to the additional bit. It would help if you could take it out into a function that gets called. 

result.endsWith("\r") seems a bit odd. Is that a specific requirement. If so, do you also need to handle \n ?  

throw new AsnDecodeException("Cannot get charset: X-Gsm7Bit"); when throwing exceptions, I'd recommend adding some context on the  input data leading to the error message. It helps a lot when

Don't forget to test for bad input data like


""
null
"zz"
"123456789ø"


I'd also just recommend creating a helper class and using hamcrest matchers to make the testing more readable i.e. assertThat(hex("f4f29c9e769f1b"), is("testing"))