protected boolean updateToBlockSubstitutionIfBetter(final List<VariantContext> neighbors) {
if (neighbors.size() < MIN_NUMBER_OF_EVENTS_TO_COMBINE_INTO_BLOCK_SUBSTITUTION)
return false;
// TODO -- need more tests to decide if this is really so good
final VariantContext first = neighbors.get(0);
final int refStartOffset = first.getStart() - refLoc.getStart();
final int refEndOffset = neighbors.get(neighbors.size() - 1).getEnd() - refLoc.getStart();
final byte[] refBases = Arrays.copyOfRange(ref, refStartOffset, refEndOffset + 1);
final byte[] hapBases = AlignmentUtils.getBasesCoveringRefInterval(refStartOffset, refEndOffset, haplotype.getBases(), haplotype.getAlignmentStartHapwrtRef(), haplotype.getCigar());
final VariantContextBuilder builder = new VariantContextBuilder(first);
builder.stop(first.getStart() + refBases.length - 1);
builder.alleles(Arrays.asList(Allele.create(refBases, true), Allele.create(hapBases)));
final VariantContext block = builder.make();
// remove all merged events
for ( final VariantContext merged : neighbors ) {
if ( remove(merged.getStart()) == null )
throw new IllegalArgumentException("Expected to remove variant context from the event map but remove said there wasn't any element there: " + merged);