### Question:
SecureIOUtils { static FileInputStream forceSecureOpenForRead(File f, String expectedOwner, String expectedGroup) throws IOException { FileInputStream fis = new FileInputStream(f); boolean success = false; try { Stat stat = NativeIO.getFstat(fis.getFD()); checkStat(f, stat.getOwner(), stat.getGroup(), expectedOwner, expectedGroup); success = true; return fis; } finally { if (!success) { fis.close(); } } }  static FileInputStream openForRead(File f, String expectedOwner, 
      String expectedGroup); static FileOutputStream createForWrite(File f, int permissions);  }### Answer:
@Test public void testReadIncorrectlyRestrictedWithSecurity() throws IOException { assumeTrue(NativeIO.isAvailable()); System.out.println("Running test with native libs..."); try { SecureIOUtils .forceSecureOpenForRead(testFilePath, "invalidUser", null).close(); fail("Didn't throw expection for wrong ownership!"); } catch (IOException ioe) { } }