auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void showBranchesDialog() { String[] branchList = new String[mBranches.size()]; int current = -1; int master = -1; for (int i = 0; i < mBranches.size(); i++) { branchList[i] = mBranches.get(i).getName(); <START> if (mBranches.get(i).getCommit().getSha() == mSelectedRef) { <END> current = i; } if (mBranches.get(i).getName().equals("master")) { master = i; } } if (mSelectedRef == null && current == -1) { current = master; } AlertDialog.Builder builder = UiUtils.createDialogBuilder(this); builder.setCancelable(true); builder.setTitle(R.string.repo_branches); builder.setSingleChoiceItems(branchList, current, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mSelectedRef = mBranches.get(which).getCommit().getSha(); mSelectBranchTag = mBranches.get(which).getName(); } }); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { refreshFragment(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }</code><technical_language>equals(), ==</technical_language>

Target:
private void showBranchesDialog() { String[] branchList = new String[mBranches.size()]; int current = -1; int master = -1; for (int i = 0; i < mBranches.size(); i++) { branchList[i] = mBranches.get(i).getName(); if (mBranches.get(i).getCommit().getSha().equals(mSelectedRef)) { current = i; } if(mBranches.get(i).getName().equals(mRepository.getMasterBranch())){ master = i; } } if (mSelectedRef == null && current == -1) { current = master; } AlertDialog.Builder builder = UiUtils.createDialogBuilder(this); builder.setCancelable(true); builder.setTitle(R.string.repo_branches); builder.setSingleChoiceItems(branchList, current, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mSelectedRef = mBranches.get(which).getCommit().getSha(); mSelectBranchTag = mBranches.get(which).getName(); } }); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { refreshFragment(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }
Source:
<code>public void testCreateAccount() throws JSONException { String userName = "TEST_USER_NAME"; String userNickName = "TEST_USER_NICK_NAME"; String userPassword = "TEST_USER_PASSWORD"; String userEmail = "TEST_USER_EMAIL"; <START> long enbale = 1; <END> JSONObject accountJSON = new JSONObject(); accountJSON.put(AccountJSONEnum.USERNAME, userName); accountJSON.put(AccountJSONEnum.NICK_NAME, userNickName); accountJSON.put(AccountJSONEnum.PASSWORD, userPassword); accountJSON.put(AccountJSONEnum.EMAIL, userEmail); accountJSON.put(AccountJSONEnum.ENABLE, enbale); Response response = mClient.target(BASE_URL) .path("accounts") .request() .post(Entity.text(accountJSON.toString())); AccountObject account = AccountObject.get(userName); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertEquals(userName, account.getUsername()); assertEquals(userNickName, account.getNickName()); assertEquals(AccountDAO.getInstance().getMd5(userPassword), account.getPassword()); assertEquals(userEmail, account.getEmail()); assertEquals(true, account.getEnable()); }</code><technical_language>int enbale = 1;</technical_language>

Target:
public void testCreateAccount() throws JSONException { String userName = "TEST_USER_NAME"; String userNickName = "TEST_USER_NICK_NAME"; String userPassword = "TEST_USER_PASSWORD"; String userEmail = "TEST_USER_EMAIL"; int enbale = 1; JSONObject accountJSON = new JSONObject(); accountJSON.put(AccountJSONEnum.USERNAME, userName); accountJSON.put(AccountJSONEnum.NICK_NAME, userNickName); accountJSON.put(AccountJSONEnum.PASSWORD, userPassword); accountJSON.put(AccountJSONEnum.EMAIL, userEmail); accountJSON.put(AccountJSONEnum.ENABLE, enbale); Response response = mClient.target(BASE_URL) .path("accounts") .request() .post(Entity.text(accountJSON.toString())); AccountObject account = AccountObject.get(userName); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); assertEquals(userName, account.getUsername()); assertEquals(userNickName, account.getNickName()); assertEquals(AccountDAO.getMd5(userPassword), account.getPassword()); assertEquals(userEmail, account.getEmail()); assertEquals(true, account.getEnable()); }
Source:
<code>private void safeCloseClient() { try { if (client != null) { client.close(); client = null; } } catch (final Exception e) { <START> Logger.getLogger(this.getClass().getName()).log( org.jboss.logmanager.Level.WARNING, <END> "Caught exception closing ModelControllerClient", e); } }</code><technical_language>expanded format</technical_language>

Target:
private void safeCloseClient() { try { if (client != null) { client.close(); client = null; } } catch (final Exception e) { Logger.getLogger(this.getClass().getName()).warnf(e, "Caught exception closing ModelControllerClient"); } }
Source:
<code>private void onNonAssignableClass(String className, Class candidate) { if (expectedType.isInterface()) { if (ClassLoaderUtil.implementsInterfaceWithSameName(candidate, expectedType)) { LOGGER.fine("There appears to be a classloading conflict. " + "Class " + className + " loaded by " + candidate.getClassLoader() + " implements " + expectedType.getName() + " from its own class loader, but it does not implement " + expectedType.getName() + " loaded by " + expectedType.getClassLoader()); } else { if (candidate.getClassLoader() != expectedType.getClassLoader()) { LOGGER.fine("There appears to be a classloading conflict. " + "Class " + className + " loaded by " + candidate.getClassLoader() + " does not " + "implement an interface with name " + expectedType.getName() + " in both class loaders." + " The interface currently loaded by " + expectedType.getClassLoader()); } else { LOGGER.fine("The class " + candidate.getName() + " does not implement the expected " + <START> "interface " + expectedType.getName()); <END> } } } }</code><technical_language>Minor: logging statements in this method conventions referring interfaces: "does implement ..." "does implement interface name ..." "does implement expected interface ..." unifying this</technical_language>

Target:
private void onNonAssignableClass(String className, Class candidate) { if (expectedType.isInterface()) { if (ClassLoaderUtil.implementsInterfaceWithSameName(candidate, expectedType)) { LOGGER.fine("There appears to be a classloading conflict. " + "Class " + className + " loaded by " + candidate.getClassLoader() + " implements " + expectedType.getName() + " from its own class loader, but it does not implement " + expectedType.getName() + " loaded by " + expectedType.getClassLoader()); } else { if (candidate.getClassLoader() != expectedType.getClassLoader()) { LOGGER.fine("There appears to be a classloading conflict. " + "Class " + className + " loaded by " + candidate.getClassLoader() + " does not " + "implement an interface with name " + expectedType.getName() + " in both class loaders. " + "The interface is currently loaded by " + expectedType.getClassLoader()); } else { LOGGER.fine("The class " + candidate.getName() + " does not implement the expected " + "interface " + expectedType.getName()); } } } }
Source:
<code>boolean errorDuringInit() { if (isInit && initException != null) { return true; } <START> return false; <END> }</code><technical_language>This simplified return (isInit && initException != null);</technical_language>

Target:
boolean errorDuringInit() { return (isInit && initException != null); }
Source:
<code>private long extractTons(ReaderWay way, long flags, EncodedDoubleValue valueEncoder, List<String> keys) { <START> String value = way.getFirstPriorityTag(keys); <END> if (Helper.isEmpty(value)) return flags; double val; try { val = stringToTons(value); } catch (Throwable t) { LOG.warn("Unable to extract tons from malformed road attribute '{}' for way (OSM_ID = {}).", value, way.getId(), t); return flags; } return valueEncoder.setDoubleValue(flags, val); }</code><technical_language>This functionality (do a test covering a change this?)</technical_language>

Target:
private long extractTons(ReaderWay way, long flags, EncodedDoubleValue valueEncoder, List<String> keys) { String value = way.getFirstPriorityTag(keys); if (Helper.isEmpty(value)) return flags; double val; try { val = stringToTons(value); } catch (Throwable t) { LOG.warn("Unable to extract tons from malformed road attribute '{}' for way (OSM_ID = {}).", value, way.getId(), t); return flags; } try { flags = valueEncoder.setDoubleValue(flags, val); } catch (IllegalArgumentException e) { LOG.warn("Unable to process tons value '{}' for way (OSM_ID = {}).", val, way.getId(), e); } return flags; }
Source:
<code>public void flushInputBuffer() { boolean signal = false; fInputLock.lock(); try { if (!fInputBuffer.isEmpty()) { fInnerQueue.put(fInputBuffer); fInputBuffer = new ConcurrentLinkedDeque<>(); fInputBufferSize = 0; signal = true; } } catch (InterruptedException e) { Activator.instance().logError("Buffered queue interrupted", e); } finally { fInputLock.unlock(); } if (signal) { fOutputLock.lock(); try { <START> fNotEmpty.signal(); <END> } finally { fOutputLock.unlock(); } } }</code><technical_language>If more thread waiting in take() blockingPeek(), this wake of them. signalAll()</technical_language>

Target:
public void flushInputBuffer() { boolean signal = false; fInputLock.lock(); try { if (!fInputBuffer.isEmpty()) { fInnerQueue.put(fInputBuffer); fInputBuffer = new ConcurrentLinkedDeque<>(); fInputBufferSize = 0; signal = true; } } catch (InterruptedException e) { Activator.instance().logError("Buffered queue interrupted", e); } finally { fInputLock.unlock(); } if (signal) { fOutputLock.lock(); try { fNotEmpty.signalAll(); } finally { fOutputLock.unlock(); } } }
Source:
<code>private ByteBuf createByteBuffer(int i, long lid, long eid) { ByteBuf bb = Unpooled.buffer(4 + 16); bb.writeLong(lid); <START> bb.writeLong(eid); <END> bb.writeInt(i); return bb; }</code><technical_language>This is missing translation of bb.putLong(eid-1);, allocation needs updated match it</technical_language>

Target:
private ByteBuf createByteBuffer(int i, long lid, long eid) { ByteBuf bb = Unpooled.buffer(4 + 16); bb.writeLong(lid); bb.writeLong(eid); bb.writeLong(eid - 1); bb.writeInt(i); return bb; }
Source:
<code>public Reply<?> create(Request request) { NewOperatorDTO dto = request.read(NewOperatorDTO.class).as(Json.class); NewOperator operator = adapt(dto); <START> Object id = repository.create(operator); <END> return Reply.with(id).as(Json.class).ok(); }</code><technical_language>IdDTO object is more readable</technical_language>

Target:
public Reply<?> create(Request request) { NewOperatorDTO dto = request.read(NewOperatorDTO.class).as(Json.class); NewOperator operator = adapt(dto); Object id = repository.create(operator); IdDTO idDTO = new IdDTO(id); return Reply.with(idDTO).as(Json.class).ok(); }
Source:
<code>public void run() throws Exception { <START> File file = new File(SamplesKt.getPrefix() + "README.md"); <END> Request request = new Request.Builder() .url("<LINK_0>") .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN)) .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } }</code><technical_language>I this. goal of samples is stand alone. alternatives</technical_language>

Target:
public void run() throws Exception { File file = new File("README.md"); Request request = new Request.Builder() .url("<LINK_0>") .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN)) .build(); try (Response response = client.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(response.body().string()); } }
Source:
<code><START> static List<InputSplit> combineSplits(PriorityQueue<LuceneIndexInputSplit> splits, long maxSize) { <END> List<InputSplit> combinedSplits = Lists.newLinkedList(); LuceneIndexInputSplit currentSplit = splits.poll(); while (currentSplit != null) { while (currentSplit.getLength() < maxSize) { LuceneIndexInputSplit nextSplit = splits.peek(); if (nextSplit == null) { break; } if (currentSplit.getLength() + nextSplit.getLength() > maxSize) { break; } currentSplit.combine(nextSplit); splits.poll(); } combinedSplits.add(currentSplit); currentSplit = splits.poll(); } return combinedSplits; }</code><technical_language>this method good protected non-static, people override combination algo</technical_language>

Target:
protected List<InputSplit> combineSplits(PriorityQueue<LuceneIndexInputSplit> splits, long maxSize) { List<InputSplit> combinedSplits = Lists.newLinkedList(); LuceneIndexInputSplit currentSplit = splits.poll(); while (currentSplit != null) { while (currentSplit.getLength() < maxSize) { LuceneIndexInputSplit nextSplit = splits.peek(); if (nextSplit == null) { break; } if (currentSplit.getLength() + nextSplit.getLength() > maxSize) { break; } currentSplit.combine(nextSplit); splits.poll(); } combinedSplits.add(currentSplit); currentSplit = splits.poll(); } return combinedSplits; }
Source:
<code>private List<NormalizationPlan> calculatePlans(final TableName tableName) { try { final TableDescriptor tblDesc = masterServices.getTableDescriptors().get(tableName); if (tblDesc != null && !tblDesc.isNormalizationEnabled()) { LOG.debug("Skipping table because normalization is disabled in its table properties.", tableName); return Collections.emptyList(); } } catch (IOException e) { LOG.debug("Skipping table because unable to access its table descriptor.", tableName, e); return Collections.emptyList(); } if (masterServices.skipRegionManagementAction("region normalizer")) { return Collections.emptyList(); <START> } <END> final List<NormalizationPlan> plans = regionNormalizer.computePlansForTable(tableName); if (CollectionUtils.isEmpty(plans)) { LOG.debug("No normalization required for table {}.", tableName); return Collections.emptyList(); } return plans; }</code><technical_language>Nit: moved place? In case needs skip action, save some some time table descriptor</technical_language>

Target:
private List<NormalizationPlan> calculatePlans(final TableName tableName) { if (masterServices.skipRegionManagementAction("region normalizer")) { return Collections.emptyList(); } try { final TableDescriptor tblDesc = masterServices.getTableDescriptors().get(tableName); if (tblDesc != null && !tblDesc.isNormalizationEnabled()) { LOG.debug("Skipping table because normalization is disabled in its table properties.", tableName); return Collections.emptyList(); } } catch (IOException e) { LOG.debug("Skipping table because unable to access its table descriptor.", tableName, e); return Collections.emptyList(); } final List<NormalizationPlan> plans = regionNormalizer.computePlansForTable(tableName); if (CollectionUtils.isEmpty(plans)) { LOG.debug("No normalization required for table {}.", tableName); return Collections.emptyList(); } return plans; }
Source:
<code><START> public OAuth2Configurer<HttpSecurity> oauth2() throws Exception { <END> return getOrApply(new OAuth2Configurer<>()); }</code><technical_language>Add @since 5.1</technical_language>

Target:
public OAuth2Configurer oauth2() throws Exception { return getOrApply(new OAuth2Configurer()); }
Source:
<code>BlobStoreCompactor(String dataDir, String storeId, StoreKeyFactory storeKeyFactory, StoreConfig config, StoreMetrics metrics, DiskIOScheduler diskIOScheduler, Log srcLog, ScheduledExecutorService scheduler, MessageStoreRecovery recovery, Time time, UUID sessionId, UUID incarnationId) { this.dataDir = new File(dataDir); <START> this.storeId = storeId; <END> this.storeKeyFactory = storeKeyFactory; this.config = config; this.metrics = metrics; this.srcLog = srcLog; this.diskIOScheduler = diskIOScheduler; this.scheduler = scheduler; this.recovery = recovery; this.time = time; this.sessionId = sessionId; this.incarnationId = incarnationId; }</code><technical_language>is interface for BlobStoreCompactor? if this is tied BlobStore Implementation, of people wanting implementation for compaction. For eg: please a hbase abstract base class for Compactor types of Compactors implementing types of compaction. writing a single page impl design doc upfront nice</technical_language>

Target:
BlobStoreCompactor(String dataDir, String storeId, StoreKeyFactory storeKeyFactory, StoreConfig config, StoreMetrics metrics, DiskIOScheduler diskIOScheduler, Log srcLog, ScheduledExecutorService scheduler, MessageStoreRecovery recovery, Time time, UUID sessionId, UUID incarnationId) throws IOException, StoreException { this.dataDir = new File(dataDir); this.storeId = storeId; this.storeKeyFactory = storeKeyFactory; this.config = config; this.srcMetrics = metrics; tgtMetrics = new StoreMetrics(storeId + METRICS_SUFFIX, metrics.getRegistry()); this.srcLog = srcLog; this.diskIOScheduler = diskIOScheduler; this.scheduler = scheduler; this.recovery = recovery; this.time = time; this.sessionId = sessionId; this.incarnationId = incarnationId; fixStateIfRequired(); }
Source:
<code>public void notIgnoredAfterOnCreateView() { assertFalse(myListFragment.didExecute); LayoutInflater inflater = mock(LayoutInflater.class); ViewGroup viewGroup = mock(ViewGroup.class); Bundle bundle = mock(Bundle.class); <START> myListFragment.onCreateView(inflater, viewGroup, bundle); <END> assertFalse(myListFragment.didExecute); myListFragment.ignoreWhenViewDestroyed(); assertTrue(myListFragment.didExecute); }</code><technical_language>pass null parameter here, is need for mocking in this case</technical_language>

Target:
public void notIgnoredAfterOnCreateView() { assertFalse(myListFragment.didExecute); myListFragment.onCreateView(null, null, null); assertFalse(myListFragment.didExecute); myListFragment.ignoreWhenViewDestroyed(); assertTrue(myListFragment.didExecute); }
Source:
<code>void configure(SSLParameters params, String[] supportedProtocols, String[] supportedCipherSuites) { <START> if (supportedProtocols != null) params.setProtocols(protocolSelector.evaluate(supportedProtocols)); <END> if (supportedCipherSuites != null) params.setCipherSuites(cipherSuiteSelector.evaluate(supportedCipherSuites)); params.setUseCipherSuitesOrder(useCipherSuitesOrder); params.setWantClientAuth(wantClientAuth); if (needClientAuth) params.setNeedClientAuth(needClientAuth); }</code><technical_language>I this Assert,checkNotNull check - in situations supported protocols cipher suites null</technical_language>

Target:
void configure(SSLParameters params, String[] supportedProtocols, String[] supportedCipherSuites) { Assert.checkNotNullParam("supportedProtocols", supportedProtocols); Assert.checkNotNullParam("supportedCipherSuites", supportedCipherSuites); params.setProtocols(protocolSelector.evaluate(supportedProtocols)); params.setCipherSuites(cipherSuiteSelector.evaluate(supportedCipherSuites)); params.setUseCipherSuitesOrder(useCipherSuitesOrder); params.setWantClientAuth(wantClientAuth); if (needClientAuth) params.setNeedClientAuth(needClientAuth); }
Source:
<code>private SurveyInstanceDto findSurveyInstance(Long surveyInstanceId) { SurveyInstance instance = instanceDao.getByKey(surveyInstanceId); SurveyInstanceDto dto = null; if (instance != null) { dto = new SurveyInstanceDto(); DtoMarshaller.copyToDto(instance, dto); SurveyedLocaleDao slDao = new SurveyedLocaleDao(); SurveyedLocale sl = slDao.getById(instance.getSurveyedLocaleId()); if (sl != null) { <START> dto.setSurveyedLocaleIdentifier(sl.getIdentifier()); <END> dto.setSurveyedLocaleDisplayName(sl.getDisplayName()); } } return dto; }</code><technical_language>Do want check for null values in sl.getIdentifier() sl.getDisplayName() fallback empty string ""</technical_language>

Target:
private SurveyInstanceDto findSurveyInstance(Long surveyInstanceId) { SurveyInstance instance = instanceDao.getByKey(surveyInstanceId); SurveyInstanceDto dto = null; if (instance != null) { dto = new SurveyInstanceDto(); DtoMarshaller.copyToDto(instance, dto); SurveyedLocaleDao slDao = new SurveyedLocaleDao(); SurveyedLocale sl = slDao.getById(instance.getSurveyedLocaleId()); if (sl != null) { dto.setSurveyedLocaleIdentifier(sl.getIdentifier() == null ? "" : sl .getIdentifier()); dto.setSurveyedLocaleDisplayName(sl.getDisplayName() == null ? "" : sl .getDisplayName()); } } return dto; }
Source:
<code>public void createCopyRequest() throws Exception { DocumentReference source = new DocumentReference("code", "Model", "Entity"); DocumentReference destination = new DocumentReference("code", Arrays.asList("Model", "Entity"), "WebHome"); CopyRequest copyRequest = requestFactory.createCopyRequest(source, destination); assertEquals(Arrays.asList(source), copyRequest.getEntityReferences()); <START> assertEquals(destination.getLastSpaceReference(), copyRequest.getDestination()); <END> assertEquals(Arrays.asList(RefactoringJobs.GROUP, "copy"), copyRequest.getId().subList(0, 2)); assertEquals(RefactoringJobs.COPY, copyRequest.getJobType()); assertEquals(this.userReference, copyRequest.getUserReference()); assertFalse(copyRequest.isDeep()); assertTrue(copyRequest.isUpdateLinks()); assertFalse(copyRequest.isInteractive()); assertTrue(copyRequest.isCheckRights()); }</code><technical_language>destination.getParent() return is more readable in this context I</technical_language>

Target:
public void createCopyRequest() throws Exception { DocumentReference source = new DocumentReference("code", "Model", "Entity"); DocumentReference destination = new DocumentReference("code", Arrays.asList("Model", "Entity"), "WebHome"); CopyRequest copyRequest = requestFactory.createCopyRequest(source, destination); assertEquals(Arrays.asList(source), copyRequest.getEntityReferences()); assertEquals(destination.getParent(), copyRequest.getDestination()); assertEquals(Arrays.asList(RefactoringJobs.GROUP, "copy"), copyRequest.getId().subList(0, 2)); assertEquals(RefactoringJobs.COPY, copyRequest.getJobType()); assertEquals(this.userReference, copyRequest.getUserReference()); assertFalse(copyRequest.isDeep()); assertTrue(copyRequest.isUpdateLinks()); assertFalse(copyRequest.isInteractive()); assertTrue(copyRequest.isCheckRights()); }
Source:
<code>private void flushFailedActions() { if (!failedActions.isEmpty()) { Iterator<Action> iterator = failedActions.values().iterator(); while (iterator.hasNext()) { Action action = iterator.next(); iterator.remove(); performSubmit(action); if (action.getPicasso().loggingEnabled) { <START> log(OWNER_DISPATCHER, VERB_REPLAYED, action.getRequest().logId()); <END> } } } }</code><technical_language>future tense above</technical_language>

Target:
private void flushFailedActions() { if (!failedActions.isEmpty()) { Iterator<Action> iterator = failedActions.values().iterator(); while (iterator.hasNext()) { Action action = iterator.next(); iterator.remove(); if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_REPLAYING, action.getRequest().logId()); } performSubmit(action); } } }
Source:
<code>public void handleContentRecovery(SPath path, byte[] content, String encoding, User source) { VirtualFile virtualFile = VirtualFileConverter.convertToVirtualFile(path); if (virtualFile == null) { return; } <START> <END> Document document = projectAPI.getDocument(virtualFile); if (document == null) { return; } int documentLength = document.getTextLength(); IFile file = path.getFile(); annotationManager.removeAnnotations(file); String text; try { text = new String(content, encoding); } catch (UnsupportedEncodingException e) { LOG.warn("Could not decode text using given encoding. Using default instead.", e); text = new String(content); } boolean wasReadOnly = !document.isWritable(); boolean wasDocumentListenerEnabled = manager.isDocumentListenerEnabled(); try { if (wasReadOnly) { document.setReadOnly(false); } if (wasDocumentListenerEnabled) { manager.disableDocumentListener(); } editorAPI.deleteText(document, 0, documentLength); editorAPI.insertText(document, 0, text); } finally { if (wasDocumentListenerEnabled) { manager.enableDocumentListener(); } if (wasReadOnly) { document.setReadOnly(true); } } Editor editor = null; if (projectAPI.isOpen(virtualFile)) { editor = projectAPI.openEditor(virtualFile, false); } annotationManager.addContributionAnnotation(source, file, 0, documentLength, editor); }</code><technical_language>warn</technical_language>

Target:
public void handleContentRecovery(SPath path, byte[] content, String encoding, User source) { VirtualFile virtualFile = VirtualFileConverter.convertToVirtualFile(path); if (virtualFile == null) { LOG.warn( "Could not recover file content of " + path + " as it could not be converted to a VirtualFile."); return; } Document document = projectAPI.getDocument(virtualFile); if (document == null) { LOG.warn( "Could not recover file content of " + path + " as no valid Document representation was returned by the IntelliJ API."); return; } int documentLength = document.getTextLength(); IFile file = path.getFile(); annotationManager.removeAnnotations(file); String text; try { text = new String(content, encoding); } catch (UnsupportedEncodingException e) { LOG.warn("Could not decode text using given encoding. Using default instead.", e); text = new String(content); NotificationPanel.showWarning( String.format( Messages.LocalEditorManipulator_incompatible_encoding_message, file.getLocation(), encoding, Charset.defaultCharset()), Messages.LocalEditorManipulator_incompatible_encoding_title); } boolean wasReadOnly = !document.isWritable(); boolean wasDocumentListenerEnabled = manager.isDocumentListenerEnabled(); try { if (wasReadOnly) { document.setReadOnly(false); } if (wasDocumentListenerEnabled) { manager.disableDocumentListener(); } editorAPI.deleteText(document, 0, documentLength); editorAPI.insertText(document, 0, text); } finally { if (wasDocumentListenerEnabled) { manager.enableDocumentListener(); } if (wasReadOnly) { document.setReadOnly(true); } } Editor editor = null; if (projectAPI.isOpen(virtualFile)) { editor = projectAPI.openEditor(virtualFile, false); } annotationManager.addContributionAnnotation(source, file, 0, documentLength, editor); }
Source:
<code>static JiraRestClient createJiraClient() throws IOException { ConnectionInfo con = new ConnectionInfo(); final URI uri; try { <START> uri = new URI(IrcBotConfig.JIRA_URL); <END> } catch(URISyntaxException ex) { throw new IOException("Cannot create JIRA URI from string " + IrcBotConfig.JIRA_URL, ex); } JiraRestClient client = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication( uri, con.userName, con.password); return client; }</code><technical_language>do this a member variable? instead of creating time</technical_language>

Target:
static JiraRestClient createJiraClient() throws IOException { ConnectionInfo con = new ConnectionInfo(); JiraRestClient client = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication( IrcBotConfig.JIRA_URI, con.userName, con.password); return client; }
Source:
<code>private static String buildMessage(InetSocketAddress address, int queueSize) { <START> return String.format("[%s] Pool is busy (no available connection and the queue has reached its max size %d", <END> address.getAddress(), queueSize); }</code><technical_language>Missing closing )</technical_language>

Target:
private static String buildMessage(InetSocketAddress address, int queueSize) { return String.format("[%s] Pool is busy (no available connection and the queue has reached its max size %d)", address.getAddress(), queueSize); }
Source:
<code>private String retrieveAuthToken(HttpClient client, String details) throws Exception { if(StringUtils.isNotBlank(details)) { Map<String, String> auth = parseAuthDetails(details); if(auth.containsKey(REALM)) { Request request = client.newRequest(StringUtils.strip(auth.get(REALM),"\"")); <START> for (Entry<String, String> e: auth.entrySet()) { <END> if(!REALM.equals(e.getKey())) { request.param(StringUtils.strip(e.getKey(),"\""), StringUtils.strip(e.getValue(),"\"")); } } LOG.debug("Auth request uri: " + request.getURI()); ContentResponse response = request.send(); LOG.debug("Auth response: " + response.toString()); if(response.getStatus() == STATUS_OK && response.getHeaders().contains(PROPERTY_CONTENT_TYPE,MEDIATYPE_APPLICATION_JSON)) { ModelNode tokenNode = ModelNode.fromJSONString(response.getContentAsString()); if(tokenNode.hasDefined("token")) { return tokenNode.get("token").asString(); }else { LOG.debug("No auth token was found on auth response: " + tokenNode.toJSONString(false)); } } else { LOG.info("Unable to retrieve authentication token from as response was not OK or unexpected content type"); } }else { LOG.info("Unable to retrieve authentication token - realm was not found in the authenticate header: " + auth.toString()); } } return null; }</code><technical_language>ideal candidate for a method ex. addRealmParameters</technical_language>

Target:
private String retrieveAuthToken(HttpClient client, String details) throws Exception { if(StringUtils.isNotBlank(details)) { Map<String, String> auth = parseAuthDetails(details); if(auth.containsKey(REALM)) { Request request = createAuthRequest(client, auth); ContentResponse response = request.send(); LOG.debug("Auth response: " + response.toString()); if(response.getStatus() == STATUS_OK && response.getHeaders().contains(PROPERTY_CONTENT_TYPE, MEDIATYPE_APPLICATION_JSON)) { ModelNode tokenNode = ModelNode.fromJSONString(response.getContentAsString()); if(tokenNode.hasDefined(TOKEN)) { return tokenNode.get(TOKEN).asString(); }else { LOG.debug("No auth token was found on auth response: " + tokenNode.toJSONString(false)); } } else { LOG.info("Unable to retrieve authentication token as response was not OK and/or unexpected content type"); } }else { LOG.info("Unable to retrieve authentication token - 'realm' was not found in the authenticate header: " + auth.toString()); } } return null; }
Source:
<code>public static <T> AnnotatedHandlerInspector<T> inspectType(Class<? extends T> handlerType, ParameterResolverFactory parameterResolverFactory) { return inspectType(handlerType, parameterResolverFactory, <START> new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader())); <END> }</code><technical_language>class loader of handlerType</technical_language>

Target:
public static <T> AnnotatedHandlerInspector<T> inspectType(Class<? extends T> handlerType, ParameterResolverFactory parameterResolverFactory) { return inspectType(handlerType, parameterResolverFactory, ClasspathHandlerDefinition.forClass(handlerType)); }
Source:
<code>private void setupTestsConfiguration() { <START> System.setProperty(TestConfigurationFactory.TEST_CONFIGURATION_URI_KEY, options.getConfigFile()); <END> System.setProperty(TestConfigurationFactory.LOCAL_TEST_CONFIGURATION_URI_KEY, options.getConfigFileLocal()); }</code><technical_language>static import</technical_language>

Target:
private void setupTestsConfiguration() { System.setProperty(TEST_CONFIGURATION_URI_KEY, options.getConfigFile()); System.setProperty(LOCAL_TEST_CONFIGURATION_URI_KEY, options.getConfigFileLocal()); }
Source:
<code>public static Optional<MediaType> getMediaType(ExampleObject example) { if (example == null) { return Optional.empty(); } <START> MediaType mediaType = new MediaType(); <END> Example exampleObject = new Example(); exampleObject.setDescription(example.name()); exampleObject.setSummary(example.summary()); exampleObject.setExternalValue(example.externalValue()); exampleObject.setValue(example.value()); mediaType.addExamples(example.name(), exampleObject); return Optional.of(mediaType); }</code><technical_language>other places, skip fields add map if empty strings</technical_language>

Target:
public static Optional<MediaType> getMediaType(ExampleObject example) { if (example == null) { return Optional.empty(); } if (StringUtils.isNotBlank(example.name())) { MediaType mediaType = new MediaType(); Example exampleObject = new Example(); if (StringUtils.isNotBlank(example.name())) { exampleObject.setDescription(example.name()); } if (StringUtils.isNotBlank(example.summary())) { exampleObject.setSummary(example.summary()); } if (StringUtils.isNotBlank(example.externalValue())) { exampleObject.setExternalValue(example.externalValue()); } if (StringUtils.isNotBlank(example.value())) { exampleObject.setValue(example.value()); } mediaType.addExamples(example.name(), exampleObject); return Optional.of(mediaType); } return Optional.empty(); }
Source:
<code><START> public void changesVisibility() throws IOException { <END> final AwsAttributes attr = new AwsAttributes(); attr.show(true); MatcherAssert.assertThat(attr.visible(), Matchers.equalTo(true)); attr.show(false); MatcherAssert.assertThat(attr.visible(), Matchers.equalTo(false)); }</code><technical_language>@darkled too, declare Exception thrown, suggested [here](<LINK_0></technical_language>

Target:
public void changesVisibility() throws Exception { final AwsAttributes attr = new AwsAttributes(); attr.show(true); MatcherAssert.assertThat(attr.visible(), Matchers.equalTo(true)); attr.show(false); MatcherAssert.assertThat(attr.visible(), Matchers.equalTo(false)); }
Source:
<code>public void setBootSequence(BootSequence value) { ArrayList<BootSequence> items = new ArrayList<BootSequence>(); for (char a : value.toString().toCharArray()) { items.add(BootSequence.valueOf((Character.valueOf(a)).toString())); <START> } <END> Object firstBootDevice = null; for (Object item : getFirstBootDevice().getItems()) { EntityModel a = (EntityModel) item; if ((BootSequence) a.getEntity() == Linq.FirstOrDefault(items)) { firstBootDevice = a; } } getFirstBootDevice().setSelectedItem(firstBootDevice); ArrayList<EntityModel> secondDeviceOptions = Linq.<EntityModel> Cast(getSecondBootDevice().getItems()); if (items.size() > 1) { BootSequence last = items.get(items.size() - 1); for (EntityModel a : secondDeviceOptions) { if (a.getEntity() != null && (BootSequence) a.getEntity() == last) { getSecondBootDevice().setSelectedItem(a); break; } } } else { for (EntityModel a : secondDeviceOptions) { if (a.getEntity() == null) { getSecondBootDevice().setSelectedItem(a); break; } } } }</code><technical_language>Instead of Character.valueOf(char).toString(), String.valueOf(char)</technical_language>

Target:
public void setBootSequence(BootSequence value) { ArrayList<BootSequence> items = new ArrayList<BootSequence>(); for (char a : value.toString().toCharArray()) { items.add(BootSequence.valueOf(String.valueOf(a))); } Object firstBootDevice = null; for (Object item : getFirstBootDevice().getItems()) { EntityModel a = (EntityModel) item; if ((BootSequence) a.getEntity() == Linq.FirstOrDefault(items)) { firstBootDevice = a; } } getFirstBootDevice().setSelectedItem(firstBootDevice); ArrayList<EntityModel> secondDeviceOptions = Linq.<EntityModel> Cast(getSecondBootDevice().getItems()); if (items.size() > 1) { BootSequence last = items.get(items.size() - 1); for (EntityModel a : secondDeviceOptions) { if (a.getEntity() != null && (BootSequence) a.getEntity() == last) { getSecondBootDevice().setSelectedItem(a); break; } } } else { for (EntityModel a : secondDeviceOptions) { if (a.getEntity() == null) { getSecondBootDevice().setSelectedItem(a); break; } } } }
Source:
<code>private Map<Guid, BrickProperties> getBrickPropertiesMap(GlusterVolumeAdvancedDetails volumeDetails) { Map<Guid, BrickProperties> brickStatusMap = new HashMap<Guid, BrickProperties>(); for (BrickDetails brickDetails : volumeDetails.getBrickDetails()) { <START> brickStatusMap.put(brickDetails.getBrickProperties().getBrickId(), brickDetails.getBrickProperties()); <END> } return brickStatusMap; }</code><technical_language>brickDetails.getBrickProperties().getBrickId() null if brick is present in DB</technical_language>

Target:
private Map<Guid, BrickProperties> getBrickPropertiesMap(GlusterVolumeAdvancedDetails volumeDetails) { Map<Guid, BrickProperties> brickStatusMap = new HashMap<Guid, BrickProperties>(); for (BrickDetails brickDetails : volumeDetails.getBrickDetails()) { if (brickDetails.getBrickProperties().getBrickId() != null) { brickStatusMap.put(brickDetails.getBrickProperties().getBrickId(), brickDetails.getBrickProperties()); } } return brickStatusMap; }
Source:
<code>static void factorNormalize(final RealMatrix input, final double[] targetFactors) { Utils.nonNull(input, "Input matrix cannot be null."); Utils.nonNull(targetFactors, "Target factors cannot be null."); <START> if (targetFactors.length != input.getRowDimension()) { <END> throw new GATKException("Number of target factors does not correspond to the number of rows."); } input.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int row, final int column, final double value) { return value / targetFactors[row]; } }); }</code><technical_language>comfortable throwing IllegalArgumentException for this, lets Utils.validateArg</technical_language>

Target:
static void factorNormalize(final RealMatrix input, final double[] targetFactors) { Utils.nonNull(input, "Input matrix cannot be null."); Utils.nonNull(targetFactors, "Target factors cannot be null."); Utils.validateArg(targetFactors.length == input.getRowDimension(), "Number of target factors does not correspond to the number of rows."); input.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int row, final int column, final double value) { return value / targetFactors[row]; } }); }
Source:
<code>private void processUnclosedSymbolicValue(ExplodedGraph.Node node, SymbolicValue sv) { List<JavaFileScannerContext.Location> flow = SECheck.flow(node, sv); flow.stream() <START> .filter(loc -> loc.syntaxNode.is(Tree.Kind.NEW_CLASS) || loc.syntaxNode.is(Tree.Kind.METHOD_INVOCATION)) <END> .forEach(loc -> reportIssue(loc.syntaxNode, String.format("Close this \"%s\".", name(loc.syntaxNode)), ImmutableSet.of(flow))); }</code><technical_language>need for or, is multiple arity</technical_language>

Target:
private void processUnclosedSymbolicValue(ExplodedGraph.Node node, SymbolicValue sv) { List<JavaFileScannerContext.Location> flow = SECheck.flow(node, sv, constraint -> constraint instanceof ObjectConstraint && ((ObjectConstraint) constraint).hasStatus(Status.OPENED)); flow.stream() .filter(loc -> loc.syntaxNode.is(Tree.Kind.NEW_CLASS, Tree.Kind.METHOD_INVOCATION)) .forEach(loc -> reportIssue(loc.syntaxNode, String.format("Close this \"%s\".", name(loc.syntaxNode)), Collections.emptySet())); }
Source:
<code>public void close() throws Exception { <START> scheduledExecutorService.shutdown(); <END> }</code><technical_language>scheduledExecutorService.shutdown(); scheduledExecutorService.awaitTermination(..);</technical_language>

Target:
public void close() throws Exception { scheduledExecutorService.shutdown(); scheduledExecutorService.awaitTermination(6000, TimeUnit.MILLISECONDS); }
Source:
<code>public void processSourceCode(Reader sourceCode, RuleSets ruleSets, RuleContext ctx) throws PMDException { determineLanguage(ctx); Initializer.initialize(); if (ruleSets.applies(ctx.getSourceCodeFile())) { <START> if (!configuration.isAutoFixes() && isCacheUpToDate(ctx)) { <END> for (final RuleViolation rv : getCachedViolationsForFile(ctx.getSourceCodeFile())) { ctx.getReport().addRuleViolation(rv); } return; } try { ruleSets.start(ctx); processSource(sourceCode, ruleSets, ctx); } catch (final ParseException pe) { configuration.getAnalysisCache().analysisFailed(ctx.getSourceCodeFile()); throw new PMDException("Error while parsing " + ctx.getSourceCodeFilename(), pe); } catch (final Exception e) { configuration.getAnalysisCache().analysisFailed(ctx.getSourceCodeFile()); throw new PMDException("Error while processing " + ctx.getSourceCodeFilename(), e); } finally { ruleSets.end(ctx); } } }</code><technical_language>this right. Enabling autofixes disables cache if file violations / violations autofixable. reprocessing files for reason</technical_language>

Target:
public void processSourceCode(Reader sourceCode, RuleSets ruleSets, RuleContext ctx) throws PMDException { determineLanguage(ctx); Initializer.initialize(); if (ruleSets.applies(ctx.getSourceCodeFile())) { if (!configuration.isAutoFixes() && configuration.getAnalysisCache().isUpToDate(ctx.getSourceCodeFile())) { for (final RuleViolation rv : configuration.getAnalysisCache().getCachedViolations(ctx.getSourceCodeFile())) { ctx.getReport().addRuleViolation(rv); } return; } try { ruleSets.start(ctx); processSource(sourceCode, ruleSets, ctx); } catch (final ParseException pe) { configuration.getAnalysisCache().analysisFailed(ctx.getSourceCodeFile()); throw new PMDException("Error while parsing " + ctx.getSourceCodeFilename(), pe); } catch (final Exception e) { configuration.getAnalysisCache().analysisFailed(ctx.getSourceCodeFile()); throw new PMDException("Error while processing " + ctx.getSourceCodeFilename(), e); } finally { ruleSets.end(ctx); } } }
Source:
<code>public Boolean visitGroupingOperation(GroupingOperation node, Void context) { if (orderByScope.isPresent()) { node.getGroupingColumns().forEach(groupingColumn -> verifyNoOrderByReferencesToOutputColumns( groupingColumn, REFERENCE_TO_OUTPUT_ATTRIBUTE_WITHIN_ORDER_BY_GROUPING, <START> "Invalid reference to output projection attribute from ORDER BY grouping" <END> )); } Optional<Expression> argumentNotInGroupBy = node.getGroupingColumns().stream() .filter(argument -> !columnReferences.containsKey(argument) || !isGroupingKey(argument)) .findAny(); if (argumentNotInGroupBy.isPresent()) { throw new SemanticException( INVALID_PROCEDURE_ARGUMENTS, node, "The arguments to GROUPING() must be expressions referenced by the GROUP BY at the associated query level. Mismatch due to %s.", argumentNotInGroupBy.get() ); } return true; }</code><technical_language>"Invalid reference output of SELECT clause grouping() expression in ORDER BY" it</technical_language>

Target:
public Boolean visitGroupingOperation(GroupingOperation node, Void context) { if (orderByScope.isPresent()) { node.getGroupingColumns().forEach(groupingColumn -> verifyNoOrderByReferencesToOutputColumns( groupingColumn, REFERENCE_TO_OUTPUT_ATTRIBUTE_WITHIN_ORDER_BY_GROUPING, "Invalid reference to output of SELECT clause from grouping() expression in ORDER BY" )); } Optional<Expression> argumentNotInGroupBy = node.getGroupingColumns().stream() .filter(argument -> !columnReferences.containsKey(argument) || !isGroupingKey(argument)) .findAny(); if (argumentNotInGroupBy.isPresent()) { throw new SemanticException( INVALID_PROCEDURE_ARGUMENTS, node, "The arguments to GROUPING() must be expressions referenced by the GROUP BY at the associated query level. Mismatch due to %s.", argumentNotInGroupBy.get() ); } return true; }
Source:
<code>public void obtain_LocalTime_using_hours_minutes_seconds_millis_nanos() { final int hours = 5; final int minutes = 31; final int seconds = 25; final int millis = 125; final long nanos = 2356L; final LocalTime localTime = LocalTimes.of(5, 31, 25, 125, 2356L); <START> final Calendar calendar = Calendar.getInstance(); <END> calendar.set(Calendar.HOUR, hours); calendar.set(Calendar.MINUTE, minutes); calendar.set(Calendar.SECOND, seconds); calendar.set(Calendar.MILLISECOND, millis); assertEquals(calendar.get(Calendar.HOUR), localTime.getHours()); assertEquals(calendar.get(Calendar.MINUTE), localTime.getMinutes()); assertEquals(calendar.get(Calendar.SECOND), localTime.getSeconds()); assertEquals(calendar.get(Calendar.MILLISECOND), localTime.getMillis()); assertEquals(nanos, localTime.getNanos()); }</code><technical_language>Please static factory methods for calendars 2, 3, 4 arguments. Consider placing a class Calendars in package Tests</technical_language>

Target:
public void obtain_LocalTime_using_hours_minutes_seconds_millis_nanos() { final LocalTime localTime = LocalTimes.of(hours, minutes, seconds, millis, nanos); assertTrue(hours == localTime.getHours()); assertTrue(minutes == localTime.getMinutes()); assertTrue(seconds == localTime.getSeconds()); assertTrue(millis == localTime.getMillis()); assertTrue(nanos == localTime.getNanos()); }
Source:
<code>public void testParseIntGarbage() throws EvaluationException { <START> try { <END> PARSE_INTEGER.evaluate(s("garbage")); } catch (EvaluationException e){ assertThat("parse_Integer(\"garbage\") throws", true, instanceOf(Boolean.class)); } }</code><technical_language>This try-catch moved @Test annotation well</technical_language>

Target:
public void testParseIntGarbage() throws EvaluationException { PARSE_INTEGER.evaluate(s("garbage")); }
Source:
<code>public Analyzer getBean(Map<String, String> initProperties, String fullPrefix, SenseiPluginRegistry pluginRegistry) { Version matchVersion = Version.valueOf(MapUtils.getString(initProperties, "matchVersion", "LUCENE_35")); <START> Pattern pattern = Pattern.compile(MapUtils.getString(initProperties, "pattern", " +")); <END> boolean toLowerCase = MapUtils.getBoolean(initProperties, "toLowerCase", true); String stopWordsStr = MapUtils.getString(initProperties, "stopWords", ""); Set<String> stopWords = new HashSet<String>(Arrays.asList(stopWordsStr.split(" *, *"))); return new PatternAnalyzer(matchVersion, pattern, toLowerCase, stopWords); }</code><technical_language>Consider changing default pattern "\\s+"</technical_language>

Target:
public Analyzer getBean(Map<String, String> initProperties, String fullPrefix, SenseiPluginRegistry pluginRegistry) { Version matchVersion = Version.valueOf(MapUtils.getString(initProperties, "matchVersion", "LUCENE_35")); Pattern pattern = Pattern.compile(MapUtils.getString(initProperties, "pattern", "\\s+")); boolean toLowerCase = MapUtils.getBoolean(initProperties, "toLowerCase", true); String stopWordsStr = MapUtils.getString(initProperties, "stopWords", ""); Set<String> stopWords = new HashSet<String>(Arrays.asList(stopWordsStr.split("\\s*,\\s*"))); return new PatternAnalyzer(matchVersion, pattern, toLowerCase, stopWords); }
Source:
<code>public void testCloneNote() throws IOException, CloneNotSupportedException, InterruptedException, InterpreterException, SchedulerException, RepositoryException { Note note = notebook.createNote(null); factory.setInterpreters(note.getId(), factory.getDefaultInterpreterSettingList()); final Paragraph p = note.addParagraph(); p.setText("hello world"); note.runAll(); while(p.isTerminated()==false || p.getResult()==null) Thread.yield(); p.setStatus(Status.RUNNING); Note cloneNote = notebook.cloneNote(note.getId(), "clone note", null); Paragraph cp = cloneNote.paragraphs.get(0); assertEquals(cp.getStatus(), Status.READY); assertEquals(cp.getId(), p.getId()); assertEquals(cp.text, p.text); assertEquals(cp.getResult().message(), p.getResult().message()); AuthenticationInfo subject = new AuthenticationInfo("user1"); Note cloneNote2 = notebook.cloneNote(note.getId(), "clone note2", subject); <START> Notebook notebook = new Notebook( <END> conf, notebookRepo, schedulerFactory, new InterpreterFactory(conf, null, null, null, depResolver), this, null, notebookAuthorization, null); assertNotNull(notebook.getNotebookAuthorization().getOwners(cloneNote2.getId())); assertEquals(1, notebook.getNotebookAuthorization().getOwners(cloneNote2.getId()).size()); Set<String> owners = new HashSet<>(); owners.add("user1"); assertEquals(owners, notebook.getNotebookAuthorization().getOwners(cloneNote2.getId())); }</code><technical_language>notebook instance</technical_language>

Target:
public void testCloneNote() throws IOException, CloneNotSupportedException, InterruptedException, InterpreterException, SchedulerException, RepositoryException { Note note = notebook.createNote(null); factory.setInterpreters(note.getId(), factory.getDefaultInterpreterSettingList()); final Paragraph p = note.addParagraph(); p.setText("hello world"); note.runAll(); while(p.isTerminated()==false || p.getResult()==null) Thread.yield(); p.setStatus(Status.RUNNING); Note cloneNote = notebook.cloneNote(note.getId(), "clone note", null); Paragraph cp = cloneNote.paragraphs.get(0); assertEquals(cp.getStatus(), Status.READY); assertEquals(cp.getId(), p.getId()); assertEquals(cp.text, p.text); assertEquals(cp.getResult().message(), p.getResult().message()); AuthenticationInfo subject = new AuthenticationInfo("user1"); Note cloneNote2 = notebook.cloneNote(note.getId(), "clone note2", subject); assertNotNull(notebook.getNotebookAuthorization().getOwners(cloneNote2.getId())); assertEquals(1, notebook.getNotebookAuthorization().getOwners(cloneNote2.getId()).size()); Set<String> owners = new HashSet<>(); owners.add("user1"); assertEquals(owners, notebook.getNotebookAuthorization().getOwners(cloneNote2.getId())); }