private static ThreadState convertThreadState(final int value){
switch (value) {
case 0:
    return ThreadState.RUNNING;
case 1:
  return ThreadState.SUSPENDED;
default :
throw new IllegalArgumentException(String.format("Received invalid thread state %d",value));
}
}

private static ThreadState convertThreadState ( final int value ) { switch ( value ) { case 0 : return ThreadState . RUNNING ; case 1 : return ThreadState . SUSPENDED ; default : throw new IllegalArgumentException ( String . format ( "Received invalid thread state %d" , value ) ) ; } }
converts the numerical value of a thread state into the proper enumeration value .
