### Question:
BlobModule extends ReactContextBaseJavaModule { public @Nullable byte[] resolve(Uri uri) { String blobId = uri.getLastPathSegment(); int offset = 0; int size = -1; String offsetParam = uri.getQueryParameter("offset"); if (offsetParam != null) { offset = Integer.parseInt(offsetParam, 10); } String sizeParam = uri.getQueryParameter("size"); if (sizeParam != null) { size = Integer.parseInt(sizeParam, 10); } return resolve(blobId, offset, size); } BlobModule(ReactApplicationContext reactContext); @Override String getName(); @Override @Nullable Map<String, Object> getConstants(); String store(byte[] data); void store(byte[] data, String blobId); void remove(String blobId); @Nullable byte[] resolve(Uri uri); @Nullable byte[] resolve(String blobId, int offset, int size); @Nullable byte[] resolve(ReadableMap blob); @ReactMethod void addNetworkingHandler(); @ReactMethod void addWebSocketHandler(final int id); @ReactMethod void removeWebSocketHandler(final int id); @ReactMethod void sendOverSocket(ReadableMap blob, int id); @ReactMethod void createFromParts(ReadableArray parts, String blobId); @ReactMethod void release(String blobId);  }### Answer:
@Test public void testResolve() { assertArrayEquals(mBytes, mBlobModule.resolve(mBlobId, 0, mBytes.length)); byte[] expectedRange = Arrays.copyOfRange(mBytes, 30, mBytes.length); assertArrayEquals(expectedRange, mBlobModule.resolve(mBlobId, 30, mBytes.length - 30)); }
@Test public void testResolveUri() { Uri uri = new Uri.Builder() .appendPath(mBlobId) .appendQueryParameter("offset", "0") .appendQueryParameter("size", String.valueOf(mBytes.length)) .build(); assertArrayEquals(mBytes, mBlobModule.resolve(uri)); }
@Test public void testResolveMap() { JavaOnlyMap blob = new JavaOnlyMap(); blob.putString("blobId", mBlobId); blob.putInt("offset", 0); blob.putInt("size", mBytes.length); assertArrayEquals(mBytes, mBlobModule.resolve(blob)); }