Buggy code:
public class LocusDataMapper { private static final DateFormat GPX_TIME_FMT = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss'Z'" , Locale . US ) ; private static final String GSAK_USERNAME = "gsak" ; private static final String ORIGINAL_COORDINATES_WAYPOINT_PREFIX = "RX" ; private static final Pattern FINAL_WAYPOINT_NAME_PATTERN = Pattern . compile ( "fin[a|á]l" , Pattern . CASE_INSENSITIVE ) ; public static List < Waypoint > toLocusPoints ( Context context , List < Geocache > caches ) { } public static Waypoint toLocusPoint ( Context context , Geocache cache ) { if ( cache == null ) return null ; Location loc = new Location ( cache . getCode ( ) ) ; loc . setLatitude ( cache . getCoordinates ( ) . getLatitude ( ) ) ; loc . setLongitude ( cache . getCoordinates ( ) . getLongitude ( ) ) ; Waypoint p = new Waypoint ( cache . getName ( ) , loc ) ; GeocachingData d = new GeocachingData ( ) ; d . setCacheID ( cache . getCode ( ) ) ; d . setId ( cache . getId ( ) ) ; d . setName ( cache . getName ( ) ) ; d . setType ( LocusDataMapper . toLocusCacheType ( cache . getCacheType ( ) ) ) ; d . setDifficulty ( cache . getDifficulty ( ) ) ; d . setTerrain ( cache . getTerrain ( ) ) ; if ( ( cache . getOwner ( ) ) != null ) { d . setOwner ( cache . getOwner ( ) . getUserName ( ) ) ; } d . setPlacedBy ( cache . getPlacedBy ( ) ) ; d . setAvailable ( cache . isAvailable ( ) ) ; d . setArchived ( cache . isArchived ( ) ) ; d . setPremiumOnly ( cache . isPremium ( ) ) ; if ( ( cache . getPlaceDate ( ) ) != null ) d . setDateHidden ( cache . getPlaceDate ( ) . getTime ( ) ) ; if ( ( cache . getPublishDate ( ) ) != null ) d . setDatePublished ( cache . getPublishDate ( ) . getTime ( ) ) ; if ( ( cache . getLastUpdateDate ( ) ) != null ) d . setDateUpdated ( cache . getLastUpdateDate ( ) . getTime ( ) ) ; d . setContainer ( LocusDataMapper . toLocusContainerType ( cache . getContainerType ( ) ) ) ; d . setFound ( cache . isFoundByUser ( ) ) ; d . setCountry ( cache . getCountryName ( ) ) ; d . setState ( cache . getStateName ( ) ) ; d . setDescriptions ( cache . getShortDescription ( ) , cache . isShortDescriptionHtml ( ) , cache . getLongDescription ( ) , cache . isLongDescriptionHtml ( ) ) ; d . setEncodedHints ( cache . getHint ( ) ) ; d . setNotes ( cache . getPersonalNote ( ) ) ; d . setFavoritePoints ( cache . getFavoritePoints ( ) ) ; <START_BUG> LocusDataMapper . sortCacheLogsByCreated ( gc . getCacheLogs ( ) ) ; <END_BUG> for ( CacheLog log : cache . getCacheLogs ( ) ) { d . logs . add ( LocusDataMapper . toLocusCacheLog ( log ) ) ; } for ( Trackable trackable : cache . getTrackables ( ) ) { d . trackables . add ( LocusDataMapper . toLocusTrackable ( trackable ) ) ; } for ( com . arcao . geocaching . api . data . Waypoint waypoint : cache . getWaypoints ( ) ) { d . waypoints . add ( LocusDataMapper . toLocusWaypoint ( waypoint ) ) ; } for ( ImageData image : cache . getImages ( ) ) { d . addImage ( LocusDataMapper . toLocusImage ( image ) ) ; } for ( AttributeType attribute : cache . getAttributes ( ) ) { d . attributes . add ( new GeocachingAttribute ( attribute . getId ( ) , attribute . isOn ( ) ) ) ; } for ( com . arcao . geocaching . api . data . Waypoint waypoint : LocusDataMapper . getWaypointsFromUserWaypoints ( context , cache . getUserWaypoints ( ) , cache . getCode ( ) ) ) { d . waypoints . add ( LocusDataMapper . toLocusWaypoint ( waypoint ) ) ; } for ( com . arcao . geocaching . api . data . Waypoint waypoint : LocusDataMapper . getWaypointsFromNote ( context , cache . getPersonalNote ( ) , cache . getCode ( ) ) ) { d . waypoints . add ( LocusDataMapper . toLocusWaypoint ( waypoint ) ) ; } p . gcData = d ; LocusDataMapper . updateCacheLocationByCorrectedCoordinates ( context , p , cache . getUserWaypoints ( ) ) ; return p ; } private static void sortCacheLogsByCreated ( List < CacheLog > cacheLogs ) { } protected static GeocachingImage toLocusImage ( ImageData image ) { } protected static void updateCacheLocationByCorrectedCoordinates ( Context mContext , Waypoint p , Iterable < UserWaypoint > userWaypoints ) { } protected static GeocachingWaypoint toLocusWaypoint ( com . arcao . geocaching . api . data . Waypoint waypoint ) { } protected static GeocachingTrackable toLocusTrackable ( Trackable trackable ) { } protected static GeocachingLog toLocusCacheLog ( CacheLog log ) { } protected static int toLocusCacheType ( CacheType cacheType ) { } protected static int toLocusContainerType ( ContainerType containerType ) { } protected static String toLocusWaypointType ( WaypointType waypointType ) { } protected static int toLocusLogType ( CacheLogType logType ) { } public static List < com . arcao . geocaching . api . data . Waypoint > getWaypointsFromNote ( Context context , String note , String cacheCode ) { } public static List < com . arcao . geocaching . api . data . Waypoint > getWaypointsFromUserWaypoints ( Context context , List < UserWaypoint > userWaypoints , String cacheCode ) { } public static Waypoint mergePoints ( Context mContext , Waypoint toPoint , Waypoint fromPoint ) { } public static void clearExtraOnDisplayCallback ( Waypoint p ) { }

Fix:
LocusDataMapper . sortCacheLogsByCreated ( cache . getCacheLogs ( ) ) ;