public static UnreliableLocalConnection createTestUnreliableLocalConnection(
      List<String> failingOperationPatterns) throws Exception {
    UnreliableLocalPlugin unreliableLocalPlugin = new UnreliableLocalPlugin();
    UnreliableLocalConnection unreliableLocalConnection =
        createTestUnreliableLocalConnectionWithoutInit(
            unreliableLocalPlugin, failingOperationPatterns);

    unreliableLocalPlugin.createTransferManager(unreliableLocalConnection).init(true);

    return unreliableLocalConnection;
  }
  public static UnreliableLocalConnection createTestUnreliableLocalConnectionWithoutInit(
      UnreliableLocalPlugin unreliableLocalPlugin, List<String> failingOperationPatterns)
      throws Exception {
    UnreliableLocalConnection unreliableLocalConnection =
        (UnreliableLocalConnection) unreliableLocalPlugin.createSettings();

    File tempRepoDir =
        TestFileUtil.createTempDirectoryInSystemTemp(
            createUniqueName("repo", new Random().nextFloat()));

    unreliableLocalConnection.setRepositoryPath(tempRepoDir);
    unreliableLocalConnection.setFailingOperationPatterns(failingOperationPatterns);
    return unreliableLocalConnection;
  }