public final static boolean fits (long val, int bits) {
final static boolean fits (long val, int bits) {
  public final static boolean fits (long val, int bits) {    val = val >> bits-1;    return (val == 0L || val == -1L);  }