public void fromShort(short n) {
    Bits[] v = Bits.values();
    set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7]);
  }
@Test
  public void fromShort() {
    Mode mode = new Mode((short) 0777);
    assertEquals(Mode.Bits.ALL, mode.getOwnerBits());
    assertEquals(Mode.Bits.ALL, mode.getGroupBits());
    assertEquals(Mode.Bits.ALL, mode.getOtherBits());

    mode = new Mode((short) 0644);
    assertEquals(Mode.Bits.READ_WRITE, mode.getOwnerBits());
    assertEquals(Mode.Bits.READ, mode.getGroupBits());
    assertEquals(Mode.Bits.READ, mode.getOtherBits());

    mode = new Mode((short) 0755);
    assertEquals(Mode.Bits.ALL, mode.getOwnerBits());
    assertEquals(Mode.Bits.READ_EXECUTE, mode.getGroupBits());
    assertEquals(Mode.Bits.READ_EXECUTE, mode.getOtherBits());
  }