RpcSystemFileCommandsHelper extends SymbolicLinkHelper { @Override public boolean setOwnerReadOnly(String fileName) { boolean set = setReadable(fileName, false, false); set &= setReadable(fileName, true, true); return set; }  @Override boolean setWritable(String fileName, boolean writable); @Override boolean setReadable(String fileName, boolean readable, boolean ownerOnly); @Override boolean setOwnerReadOnly(String fileName); @Override boolean setExecutable(String fileName, boolean executable, boolean ownerOnly); @Override boolean canExecute(String fileName); @Override boolean isSymlink(String fileName);  }
@Test public void setOwnerReadOnly() throws Exception { boolean setReadable = rpcSystemFileCommandsHelper.setReadable(mockFile.toString(), false, false); assertThat(setReadable, is(true)); setReadable = rpcSystemFileCommandsHelper.setReadable(mockFile.toString(), true, false); assertThat(setReadable, is(true)); boolean setOwnerReadOnly = rpcSystemFileCommandsHelper .setOwnerReadOnly(mockFile.toString()); assertThat(setOwnerReadOnly, is(true)); setOwnerReadOnly = rpcSystemFileCommandsHelper.setOwnerReadOnly(noExistFileName); assertThat(setOwnerReadOnly, is(false)); }