test_class.file: tool/hash/src/test/java/org/openscience/cdk/hash/stereo/MultiStereoEncoderTest.java
test_class.identifier: MultiStereoEncoderTest
test_case.body: @Test
      public void testEncode() throws Exception {
  
          StereoEncoder a = mock(StereoEncoder.class);
          StereoEncoder b = mock(StereoEncoder.class);
  
          StereoEncoder encoder = new MultiStereoEncoder(Arrays.asList(a, b));
  
          long[] current = new long[5];
          long[] next = new long[5];
  
          when(a.encode(current, next)).thenReturn(true);
          when(b.encode(current, next)).thenReturn(true);
  
          // configured once
          assertTrue(encoder.encode(current, next));
  
          // not configured again
          assertFalse(encoder.encode(current, next));
  
          verify(a, times(1)).encode(current, next);
          verify(b, times(1)).encode(current, next);
  
      }
test_case.class_method_signature: MultiStereoEncoderTest.testEncode()
test_case.full_signature: @Test public void testEncode()
test_case.identifier: testEncode
test_case.invocations: mock mock asList thenReturn when encode thenReturn when encode assertTrue encode assertFalse encode encode verify times encode verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEncode()
focal_class.declarator: unconfigured
focal_class.modifier: private final
focal_class.original_string: private final BitSet              unconfigured;
focal_class.type: BitSet
focal_class.var_name: unconfigured
focal_class.declarator: encoders
focal_class.modifier: private final
focal_class.original_string: private final List<StereoEncoder> encoders;
focal_class.type: List<StereoEncoder>
focal_class.var_name: encoders
focal_class.file: tool/hash/src/main/java/org/openscience/cdk/hash/stereo/MultiStereoEncoder.java
focal_class.identifier: MultiStereoEncoder
focal_class.interfaces: implements StereoEncoder
focal_class.class_method_signature: MultiStereoEncoder.MultiStereoEncoder(List<StereoEncoder> encoders)
focal_class.full_signature: public  MultiStereoEncoder(List<StereoEncoder> encoders)
focal_class.identifier: MultiStereoEncoder
focal_class.modifiers: public
focal_class.parameters: (List<StereoEncoder> encoders)
focal_class.signature:  MultiStereoEncoder(List<StereoEncoder> encoders)
focal_class.class_method_signature: MultiStereoEncoder.encode(long[] current, long[] next)
focal_class.full_signature: @Override public boolean encode(long[] current, long[] next)
focal_class.identifier: encode
focal_class.modifiers: @Override public
focal_class.parameters: (long[] current, long[] next)
focal_class.return: boolean
focal_class.signature: boolean encode(long[] current, long[] next)
focal_class.class_method_signature: MultiStereoEncoder.reset()
focal_class.full_signature: @Override public void reset()
focal_class.identifier: reset
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_method.body: @Override
      public boolean encode(long[] current, long[] next) {
          boolean configured = false;
  
          for (int i = unconfigured.nextSetBit(0); i >= 0; i = unconfigured.nextSetBit(i + 1)) {
  
              if (encoders.get(i).encode(current, next)) {
                  unconfigured.clear(i); // don't configure again (unless reset)
                  configured = true;
              }
          }
          return configured;
      }
focal_method.class_method_signature: MultiStereoEncoder.encode(long[] current, long[] next)
focal_method.full_signature: @Override public boolean encode(long[] current, long[] next)
focal_method.identifier: encode
focal_method.invocations: nextSetBit nextSetBit encode get clear
focal_method.modifiers: @Override public
focal_method.parameters: (long[] current, long[] next)
focal_method.return: boolean
focal_method.signature: boolean encode(long[] current, long[] next)