JnaNativePty extends AbstractPty implements Pty { protected static FileDescriptor newDescriptor(int fd) { try { Constructor<FileDescriptor> cns = FileDescriptor.class.getDeclaredConstructor(int.class); cns.setAccessible(true); return cns.newInstance(fd); } catch (Throwable e) { throw new RuntimeException("Unable to create FileDescriptor", e); } } protected  JnaNativePty(int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name); protected  JnaNativePty(int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name); static JnaNativePty current(); static JnaNativePty open(Attributes attr, Size size); @Override void close(); int getMaster(); int getSlave(); int getSlaveOut(); String getName(); FileDescriptor getMasterFD(); FileDescriptor getSlaveFD(); FileDescriptor getSlaveOutFD(); InputStream getMasterInput(); OutputStream getMasterOutput(); OutputStream getSlaveOutput(); @Override String toString();  }
@Test public void testDescriptor() { assumeTrue(!System.getProperty( "os.name" ).startsWith( "Windows")); assertNotNull(JnaNativePty.newDescriptor(4)); }