test_class.declarator: result
test_class.modifier: private
test_class.original_string: private DummyBooleanOpenProtocol result;
test_class.type: DummyBooleanOpenProtocol
test_class.var_name: result
test_class.file: core/src/test/java/dk/alexandra/fresco/suite/dummy/bool/DummyBooleanBuilderFactoryTest.java
test_class.identifier: DummyBooleanBuilderFactoryTest
test_case.body: @Test
    public void createBinary() {
      ProtocolBuilderBinary builder = mock(ProtocolBuilderBinary.class);
      DRes<SBool> closed = mock(DRes.class);
      DummyBooleanSBool closedOut = mock(DummyBooleanSBool.class);
  
      when(closed.out()).thenReturn(closedOut);
      when(closedOut.getValue()).thenReturn(true);
      when(builder.append(any(DummyBooleanOpenProtocol.class)))
          .then(
              invocationOnMock -> {
                result = invocationOnMock.getArgument(0);
                return null;
              });
  
      Binary binary = new DummyBooleanBuilderFactory().createBinary(builder);
      binary.open(closed, 2);
  
      ResourcePool resourcePool = mock(ResourcePool.class);
      when(resourcePool.getMyId()).thenReturn(2);
  
      Assert.assertNotNull(result);
      Assert.assertNull(result.out());
      Assert.assertEquals(
          result.evaluate(1, resourcePool, mock((Network.class))), EvaluationStatus.IS_DONE);
      Assert.assertTrue(result.out());
    }
test_case.class_method_signature: DummyBooleanBuilderFactoryTest.createBinary()
test_case.full_signature: @Test public void createBinary()
test_case.identifier: createBinary
test_case.invocations: mock mock mock thenReturn when out thenReturn when getValue then when append any getArgument createBinary open mock thenReturn when getMyId assertNotNull assertNull out assertEquals evaluate mock assertTrue out
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createBinary()
focal_class.declarator: rand
focal_class.modifier: private final
focal_class.original_string: private final Random rand;
focal_class.type: Random
focal_class.var_name: rand
focal_class.file: core/src/main/java/dk/alexandra/fresco/suite/dummy/bool/DummyBooleanBuilderFactory.java
focal_class.identifier: DummyBooleanBuilderFactory
focal_class.interfaces: implements BuilderFactoryBinary
focal_class.class_method_signature: DummyBooleanBuilderFactory.DummyBooleanBuilderFactory()
focal_class.full_signature: public  DummyBooleanBuilderFactory()
focal_class.identifier: DummyBooleanBuilderFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  DummyBooleanBuilderFactory()
focal_class.class_method_signature: DummyBooleanBuilderFactory.createBinary(ProtocolBuilderBinary builder)
focal_class.full_signature: @Override public Binary createBinary(ProtocolBuilderBinary builder)
focal_class.identifier: createBinary
focal_class.modifiers: @Override public
focal_class.parameters: (ProtocolBuilderBinary builder)
focal_class.return: Binary
focal_class.signature: Binary createBinary(ProtocolBuilderBinary builder)
focal_method.body: @Override
    public Binary createBinary(ProtocolBuilderBinary builder) {
      return new Binary() {
  
        @Override
        public DRes<SBool> known(boolean value) {
          return () -> new DummyBooleanSBool(value);
        }
  
        @Override
        public DRes<SBool> input(boolean value, int inputParty) {
          DummyBooleanCloseProtocol c = new DummyBooleanCloseProtocol(inputParty, () -> value);
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<SBool> randomBit() {
          DummyBooleanNativeProtocol<SBool> c = new DummyBooleanNativeProtocol<SBool>() {
  
            DummyBooleanSBool bit;
  
            @Override
            public EvaluationStatus evaluate(int round, ResourcePool resourcePool,
                Network network) {
              bit = new DummyBooleanSBool(rand.nextBoolean());
              return EvaluationStatus.IS_DONE;
            }
  
            @Override
            public SBool out() {
              return bit;
            }
          };
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<Boolean> open(DRes<SBool> secretShare) {
          DummyBooleanOpenProtocol c = new DummyBooleanOpenProtocol(secretShare);
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<Boolean> open(DRes<SBool> secretShare, int outputParty) {
          DummyBooleanOpenProtocol c = new DummyBooleanOpenProtocol(secretShare, outputParty);
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<SBool> and(DRes<SBool> a, DRes<SBool> b) {
          DummyBooleanAndProtocol c = new DummyBooleanAndProtocol(a, b);
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<SBool> xor(DRes<SBool> a, DRes<SBool> b) {
          DummyBooleanXorProtocol c = new DummyBooleanXorProtocol(a, b);
          builder.append(c);
          return c;
        }
  
        @Override
        public DRes<SBool> not(DRes<SBool> a) {
          DummyBooleanNotProtocol c = new DummyBooleanNotProtocol(a);
          builder.append(c);
          return c;
        }
      };
    }
focal_method.class_method_signature: DummyBooleanBuilderFactory.createBinary(ProtocolBuilderBinary builder)
focal_method.full_signature: @Override public Binary createBinary(ProtocolBuilderBinary builder)
focal_method.identifier: createBinary
focal_method.invocations: append nextBoolean append append append append append append
focal_method.modifiers: @Override public
focal_method.parameters: (ProtocolBuilderBinary builder)
focal_method.return: Binary
focal_method.signature: Binary createBinary(ProtocolBuilderBinary builder)