### Question:
FilePermissions { public static FilePermissions fromPosixFilePermissions( Set<PosixFilePermission> posixFilePermissions) { int permissionBits = 0; for (PosixFilePermission permission : posixFilePermissions) { permissionBits |= Objects.requireNonNull(PERMISSION_MAP.get(permission)); } return new FilePermissions(permissionBits); } FilePermissions(int permissionBits); static FilePermissions fromOctalString(String octalPermissions); static FilePermissions fromPosixFilePermissions(
      Set<PosixFilePermission> posixFilePermissions); int getPermissionBits(); String toOctalString(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static final FilePermissions DEFAULT_FILE_PERMISSIONS; static final FilePermissions DEFAULT_FOLDER_PERMISSIONS; }### Answer:
@Test public void testFromPosixFilePermissions() { Assert.assertEquals( new FilePermissions(0000), FilePermissions.fromPosixFilePermissions(ImmutableSet.of())); Assert.assertEquals( new FilePermissions(0110), FilePermissions.fromPosixFilePermissions( ImmutableSet.of(PosixFilePermission.OWNER_EXECUTE, PosixFilePermission.GROUP_EXECUTE))); Assert.assertEquals( new FilePermissions(0202), FilePermissions.fromPosixFilePermissions( ImmutableSet.of(PosixFilePermission.OWNER_WRITE, PosixFilePermission.OTHERS_WRITE))); Assert.assertEquals( new FilePermissions(0044), FilePermissions.fromPosixFilePermissions( ImmutableSet.of(PosixFilePermission.GROUP_READ, PosixFilePermission.OTHERS_READ))); Assert.assertEquals( new FilePermissions(0777), FilePermissions.fromPosixFilePermissions( ImmutableSet.copyOf(PosixFilePermission.values()))); }