@Test public void testNoSiblings() throws Exception { final List<CursorObject> siblings = Collections.emptyList(); final CursorObject actual = resolver.resolve(siblings); assertThat(actual).isNull(); }
@Nullable @Override public CursorObject resolve(final List<CursorObject> siblings) throws UnresolvedConflictException { LOGGER.debug("Found {} siblings", siblings.size()); siblingCounts.update(siblings.size()); if (siblings.size() > 1) { Collections.sort(siblings); return siblings.get(0); } else if (siblings.size() == 1) { return siblings.get(0); } else { return null; } }
CursorResolver implements ConflictResolver<CursorObject> { @Nullable @Override public CursorObject resolve(final List<CursorObject> siblings) throws UnresolvedConflictException { LOGGER.debug("Found {} siblings", siblings.size()); siblingCounts.update(siblings.size()); if (siblings.size() > 1) { Collections.sort(siblings); return siblings.get(0); } else if (siblings.size() == 1) { return siblings.get(0); } else { return null; } } }
CursorResolver implements ConflictResolver<CursorObject> { @Nullable @Override public CursorObject resolve(final List<CursorObject> siblings) throws UnresolvedConflictException { LOGGER.debug("Found {} siblings", siblings.size()); siblingCounts.update(siblings.size()); if (siblings.size() > 1) { Collections.sort(siblings); return siblings.get(0); } else if (siblings.size() == 1) { return siblings.get(0); } else { return null; } } CursorResolver(); }
CursorResolver implements ConflictResolver<CursorObject> { @Nullable @Override public CursorObject resolve(final List<CursorObject> siblings) throws UnresolvedConflictException { LOGGER.debug("Found {} siblings", siblings.size()); siblingCounts.update(siblings.size()); if (siblings.size() > 1) { Collections.sort(siblings); return siblings.get(0); } else if (siblings.size() == 1) { return siblings.get(0); } else { return null; } } CursorResolver(); @Nullable @Override CursorObject resolve(final List<CursorObject> siblings); }
CursorResolver implements ConflictResolver<CursorObject> { @Nullable @Override public CursorObject resolve(final List<CursorObject> siblings) throws UnresolvedConflictException { LOGGER.debug("Found {} siblings", siblings.size()); siblingCounts.update(siblings.size()); if (siblings.size() > 1) { Collections.sort(siblings); return siblings.get(0); } else if (siblings.size() == 1) { return siblings.get(0); } else { return null; } } CursorResolver(); @Nullable @Override CursorObject resolve(final List<CursorObject> siblings);  }