test_class.file: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/MutableSegmentReferencesTest.java
test_class.identifier: MutableSegmentReferencesTest
test_case.body: @Test
      public void referencesShouldBeGreaterThanZero() throws Exception {
          MemoryStore store = new MemoryStore();
          SegmentId id = store.getSegmentIdProvider().newDataSegmentId();
  
          MutableSegmentReferences table = new MutableSegmentReferences();
          int reference = table.addOrReference(id);
          assertEquals(1, reference);
      }
test_case.class_method_signature: MutableSegmentReferencesTest.referencesShouldBeGreaterThanZero()
test_case.full_signature: @Test public void referencesShouldBeGreaterThanZero()
test_case.identifier: referencesShouldBeGreaterThanZero
test_case.invocations: newDataSegmentId getSegmentIdProvider addOrReference assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void referencesShouldBeGreaterThanZero()
focal_class.declarator: lock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object lock = new Object();
focal_class.type: Object
focal_class.var_name: lock
focal_class.declarator: ids = newArrayList()
focal_class.modifier: private final
focal_class.original_string: private final List<SegmentId> ids = newArrayList();
focal_class.type: List<SegmentId>
focal_class.var_name: ids
focal_class.declarator: numbers = newHashMap()
focal_class.modifier: private final
focal_class.original_string: private final Map<SegmentId, Integer> numbers = newHashMap();
focal_class.type: Map<SegmentId, Integer>
focal_class.var_name: numbers
focal_class.file: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/MutableSegmentReferences.java
focal_class.identifier: MutableSegmentReferences
focal_class.interfaces: implements SegmentReferences
focal_class.class_method_signature: MutableSegmentReferences.getSegmentId(int reference)
focal_class.full_signature: @Override public SegmentId getSegmentId(int reference)
focal_class.identifier: getSegmentId
focal_class.modifiers: @Override public
focal_class.parameters: (int reference)
focal_class.return: SegmentId
focal_class.signature: SegmentId getSegmentId(int reference)
focal_class.class_method_signature: MutableSegmentReferences.addOrReference(SegmentId id)
focal_class.full_signature:  int addOrReference(SegmentId id)
focal_class.identifier: addOrReference
focal_class.parameters: (SegmentId id)
focal_class.return: int
focal_class.signature: int addOrReference(SegmentId id)
focal_class.class_method_signature: MutableSegmentReferences.size()
focal_class.full_signature:  int size()
focal_class.identifier: size
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int size()
focal_class.class_method_signature: MutableSegmentReferences.contains(SegmentId id)
focal_class.full_signature:  boolean contains(SegmentId id)
focal_class.identifier: contains
focal_class.parameters: (SegmentId id)
focal_class.return: boolean
focal_class.signature: boolean contains(SegmentId id)
focal_class.class_method_signature: MutableSegmentReferences.iterator()
focal_class.full_signature: @NotNull @Override public Iterator<SegmentId> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: Iterator<SegmentId>
focal_class.signature: Iterator<SegmentId> iterator()
focal_method.body: int addOrReference(SegmentId id) {
          Integer number = numbers.get(id);
  
          if (number != null) {
              return number;
          }
  
          synchronized (lock) {
              number = numbers.get(id);
  
              if (number != null) {
                  return number;
              }
  
              ids.add(id);
              number = ids.size();
              numbers.put(id, number);
              return number;
          }
      }
focal_method.class_method_signature: MutableSegmentReferences.addOrReference(SegmentId id)
focal_method.full_signature:  int addOrReference(SegmentId id)
focal_method.identifier: addOrReference
focal_method.invocations: get get add size put
focal_method.parameters: (SegmentId id)
focal_method.return: int
focal_method.signature: int addOrReference(SegmentId id)