code: public static final FileAttribute<GroupPrincipal> getGroupAsAttribute(String group) throws IOException
      {
          if (supports("posix"))
          {
              UserPrincipalLookupService upls = FileSystems.getDefault().getUserPrincipalLookupService();
              GroupPrincipal grp = upls.lookupPrincipalByGroupName(group);
              return new FileAttributeImpl<>("posix:group", grp);
          }
          else
          {
              return null;
          }
      }
docs: Return file group as attribute if posix supported. Otherwise returns null.
  @param group
  @return
  @throws IOException