private boolean isValidMessage(BigInteger m,BigInteger p){
  return m.compareTo(p) < 0;
}

private boolean isValidMessage ( BigInteger m , BigInteger p ) { return m . compareTo ( p ) < 0 ; }
just checking whether the message m is actually less than the group order p
