Improving Custom Comparator.compare() method
You should consider using the native language/library support for work like this.

Let me prime that, by adding this private function to your clas:

private Integer getTransNombre() {
    return transportista == null ? null : transportista.getNombre();
}


That gets the number, if the transportista is not null. Now, using that function, we can create a reusable comparator instance using the tricks that Java 8 introduces. Consider these chained comparators:

private static final Comparator&lt;SeguimientoSeccion&gt; COMP = Comparator.comparing(SeguimientoSeccion::getYear)
        .thenComparing(SeguimientoSeccion::getMonth)
        .thenComparing(SeguimientoSeccion::getFijacion, Comparator.nullsLast(Comparator.naturalOrder()))
        .thenComparing(SeguimientoSeccion::getTransNombre, Comparator.nullsLast(Comparator.naturalOrder()));


How does that work? It gets details about the instances, if they compare as "equals" then the next test is run. You can sort nulls to the end, and you can go from there.

If you still need your comparator class, it could be:

public class SeguimientoSeccionComparator implements Comparator&lt;SeguimientoSeccion&gt; {
    public int compare(SeguimientoSeccion o1, SeguimientoSeccion o2) {
        return COMP.compare(o1, o2);
    }
}