Why not use 
if (timarkers.remove(timarker)){
timarker.getMarker().remove();
timarker.getProxy().setTiMarker(null); // need a null check for getProxy()
}
in both if blocks? BTW, should use else if (xxx instanceof xxxx) for the second type check.