InputSumExample { public <ResourcePoolT extends ResourcePool> void runApplication( SecureComputationEngine<ResourcePoolT, ProtocolBuilderNumeric> sce, ResourcePoolT resourcePool, Network network) { InputApplication inputApp; int myId = resourcePool.getMyId(); int[] inputs = new int[]{1, 2, 3, 7, 8, 12, 15, 17}; if (myId == 1) { inputApp = new InputApplication(inputs); } else { inputApp = new InputApplication(inputs.length); } SumAndOutputApplication app = new SumAndOutputApplication(inputApp); BigInteger result = sce.runApplication(app, resourcePool, network); int sum = 0; for (int i : inputs) { sum += i; } System.out.println("Expected result: " + sum + ", Result was: " + result); } InputSumExample(); void runApplication(
      SecureComputationEngine<ResourcePoolT, ProtocolBuilderNumeric> sce,
      ResourcePoolT resourcePool, Network network); static void main(String[] args);  }
@Test public <ResourcePoolT extends ResourcePool> void testInput() { final TestThreadFactory<ResourcePoolT, ProtocolBuilderNumeric> f = new TestThreadFactory<ResourcePoolT, ProtocolBuilderNumeric>() { @Override public TestThread<ResourcePoolT, ProtocolBuilderNumeric> next() { return new TestThread<ResourcePoolT, ProtocolBuilderNumeric>() { @Override public void test() { new InputSumExample() .runApplication(conf.sce, conf.getResourcePool(), conf.getNetwork()); } }; } }; runTest(f, false, 3); }
@Test public <ResourcePoolT extends ResourcePool> void testInput_dummy() { final TestThreadFactory<ResourcePoolT, ProtocolBuilderNumeric> f = new TestThreadFactory<ResourcePoolT, ProtocolBuilderNumeric>() { @Override public TestThread<ResourcePoolT, ProtocolBuilderNumeric> next() { return new TestThread<ResourcePoolT, ProtocolBuilderNumeric>() { @Override public void test() { new InputSumExample() .runApplication(conf.sce, conf.getResourcePool(), conf.getNetwork()); } }; } }; runTest(f, true, 3); }