Java pagination algorithm
the most simple algorithm would be to calculate the start and end indices

    // set start index relative to selected  
    int start = selectedPage - (offset / 2);
    // adjust for first pages   
    start = Math.max(start, 1);
    // set end index relative to start    
    int end = start + offset - 1;
    // adjust start and end for last pages     
    if (end &gt; totalPages) {
        end = totalPages;
        start = end - offset + 1;
    }

    return IntStream.rangeClosed(start, end).boxed()
        .collect(Collectors.toList());


as for code review: 


method signatures correctly return interface List. however, there are two places where you initialize the list with a concrete implementation. now imagine you would decide that ArrayList is better suited. you need to remember to modify two places. 
while on the subject: don't use LinkedList. it has an extremely narrow use case where it is preferable over ArrayList. this is not one of them. Especially if you initialize the ArrayList with initial size.
use Java 8 collection stream (if you've learned it) it is more efficient and concise than for loop 
The code does not use java standard indentation. code inside if block should be indented inward.