test_class.file: oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/datastore/InMemoryDataRecordTest.java
test_class.identifier: InMemoryDataRecordTest
test_case.body: @Test
      public void testGetInstance() throws Exception {
          int length = 400;
          byte[] data = new byte[length];
          new Random().nextBytes(data);
  
          DataRecord dr = InMemoryDataRecord.getInstance(data);
          assertTrue(InMemoryDataRecord.isInstance(dr.getIdentifier().toString()));
  
          DataRecord dr2 = InMemoryDataRecord.getInstance(dr.getIdentifier().toString());
  
          assertTrue(IOUtils.contentEquals(dr.getStream(), dr2.getStream()));
          assertTrue(IOUtils.contentEquals(dr.getStream(), new ByteArrayInputStream(data)));
  
          assertEquals(length, dr.getLength());
          assertEquals(dr2.getLength(), dr.getLength());
  
          assertEquals(dr, dr2);
      }
test_case.class_method_signature: InMemoryDataRecordTest.testGetInstance()
test_case.full_signature: @Test public void testGetInstance()
test_case.identifier: testGetInstance
test_case.invocations: nextBytes getInstance assertTrue isInstance toString getIdentifier getInstance toString getIdentifier assertTrue contentEquals getStream getStream assertTrue contentEquals getStream assertEquals getLength assertEquals getLength getLength assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetInstance()
focal_class.declarator: log = LoggerFactory.getLogger(InMemoryDataRecord.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger log = LoggerFactory.getLogger(InMemoryDataRecord.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: PREFIX = "0x"
focal_class.modifier: private static final
focal_class.original_string: private static final String PREFIX = "0x";
focal_class.type: String
focal_class.var_name: PREFIX
focal_class.declarator: data
focal_class.modifier: private final
focal_class.original_string: private final byte[] data;
focal_class.type: byte[]
focal_class.var_name: data
focal_class.declarator: identifier
focal_class.modifier: private
focal_class.original_string: private DataIdentifier identifier;
focal_class.type: DataIdentifier
focal_class.var_name: identifier
focal_class.declarator: EMPTY_BYTE_ARRAY = new byte[0]
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
focal_class.type: byte[]
focal_class.var_name: EMPTY_BYTE_ARRAY
focal_class.declarator: EMPTY = new InMemoryDataRecord(EMPTY_BYTE_ARRAY)
focal_class.modifier: private static final
focal_class.original_string: private static final InMemoryDataRecord EMPTY = new InMemoryDataRecord(EMPTY_BYTE_ARRAY);
focal_class.type: InMemoryDataRecord
focal_class.var_name: EMPTY
focal_class.file: oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/InMemoryDataRecord.java
focal_class.identifier: InMemoryDataRecord
focal_class.interfaces: implements DataRecord
focal_class.class_method_signature: InMemoryDataRecord.InMemoryDataRecord(byte[] data)
focal_class.full_signature: private  InMemoryDataRecord(byte[] data)
focal_class.identifier: InMemoryDataRecord
focal_class.modifiers: private
focal_class.parameters: (byte[] data)
focal_class.signature:  InMemoryDataRecord(byte[] data)
focal_class.class_method_signature: InMemoryDataRecord.getInstance(byte[] data)
focal_class.full_signature: static InMemoryDataRecord getInstance(byte[] data)
focal_class.identifier: getInstance
focal_class.modifiers: static
focal_class.parameters: (byte[] data)
focal_class.return: InMemoryDataRecord
focal_class.signature: InMemoryDataRecord getInstance(byte[] data)
focal_class.class_method_signature: InMemoryDataRecord.isInstance(String id)
focal_class.full_signature: public static boolean isInstance(String id)
focal_class.identifier: isInstance
focal_class.modifiers: public static
focal_class.parameters: (String id)
focal_class.return: boolean
focal_class.signature: boolean isInstance(String id)
focal_class.class_method_signature: InMemoryDataRecord.getInstance(String id)
focal_class.full_signature: public static InMemoryDataRecord getInstance(String id)
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: (String id)
focal_class.return: InMemoryDataRecord
focal_class.signature: InMemoryDataRecord getInstance(String id)
focal_class.class_method_signature: InMemoryDataRecord.getIdentifier()
focal_class.full_signature: @Override public DataIdentifier getIdentifier()
focal_class.identifier: getIdentifier
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DataIdentifier
focal_class.signature: DataIdentifier getIdentifier()
focal_class.class_method_signature: InMemoryDataRecord.getReference()
focal_class.full_signature: @Override public String getReference()
focal_class.identifier: getReference
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getReference()
focal_class.class_method_signature: InMemoryDataRecord.getLength()
focal_class.full_signature: @Override public long getLength()
focal_class.identifier: getLength
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getLength()
focal_class.class_method_signature: InMemoryDataRecord.getStream()
focal_class.full_signature: public InputStream getStream()
focal_class.identifier: getStream
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: InputStream
focal_class.signature: InputStream getStream()
focal_class.class_method_signature: InMemoryDataRecord.getLastModified()
focal_class.full_signature: @Override public long getLastModified()
focal_class.identifier: getLastModified
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getLastModified()
focal_class.class_method_signature: InMemoryDataRecord.toString()
focal_class.full_signature: public String toString()
focal_class.identifier: toString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: InMemoryDataRecord.equals(Object obj)
focal_class.full_signature: public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: InMemoryDataRecord.hashCode()
focal_class.full_signature: public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: static InMemoryDataRecord getInstance(byte[] data) {
          if (data.length == 0) {
              return EMPTY;
          } else {
              return new InMemoryDataRecord(data);
          }
      }
focal_method.class_method_signature: InMemoryDataRecord.getInstance(byte[] data)
focal_method.full_signature: static InMemoryDataRecord getInstance(byte[] data)
focal_method.identifier: getInstance
focal_method.modifiers: static
focal_method.parameters: (byte[] data)
focal_method.return: InMemoryDataRecord
focal_method.signature: InMemoryDataRecord getInstance(byte[] data)