Q:

Stream and Filter using Functional Programming for Server object in List

I have two List<Server> current and List<Server> serverList but I want to filter out Server from current which are already present in serverList.
Now the Unique based on which it will check is List<IPAddress> which is inside both of above list.
IPAddress POJO has two fields String ipaddress, boolean primary 
List has multiple secondary ip but one unique primary ip therefore we need to filter out based on this primary ip and we can check only if it is boolean true to know if its primary ip.
I think this will make a very complex stream filter logic therefore I need help I tried but I am not expert in functional programming.
serverList.stream().filter(new Predicate<? extends Server>() {

                })

Error: The method filter(Predicate) in the type
  Stream is not applicable for the arguments (new Predicate(){})

Server POJO has getters and setters same as IPAddress. List is inside this Server POJO as getter and setter.
public class Server {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
    public Integer id;

    @OneToMany (mappedBy = "server",cascade = CascadeType.ALL, orphanRemoval = true)
    private List<IPAddress> ipaddresses;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setIpaddresses(List<IPAddress> ipaddresses) {
        this.ipaddresses = ipaddresses;
    }

    public List<IPAddress> getIpaddresses() {
        return ipaddresses;
    }
}

IPAddress POJO
public class IPAddress {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID")
    public Integer id;

    @Column(name="ipaddress")
    private String ipaddress;

    @Column(name="primaryIP")
    private boolean primary;

    @ManyToOne
    @JsonIgnore
    @JoinColumn(name = "server_id")
    private Server server;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIpaddress() {
        return ipaddress;
    }

    public void setIpaddress(String ipaddress) {
        this.ipaddress = ipaddress;
    }

    public boolean isPrimary() {
        return primary;
    }

    public void setPrimary(boolean primary) {
        this.primary = primary;
    }

    public Server getServer() {
        return server;
    }

    public void setServer(Server server) {
        this.server = server;
    }

}

A:

This is actually quite simple.
First, add a method in Server to get its primary address:
public String getPrimaryIpAddress() {
    return ipaddresses.stream()
        .filter(IPAddress::isPrimary)
        .findAny()
        .orElseThrow(() -> new IllegalStateException("there should be a primary address")
        .getIpaddress();
}

Then create a Set of primary addresses
List<Server> serverList = ...
Set<String> primaryIpAddresses = serverList.stream()
    .map(Server::getPrimaryIpAddress)
    .collect(Collectors.toSet());

Then filter the list of servers:
List<Server> currrent = ...

List<Server> filtered = current.stream()
    .filter(s -> !primaryIpAddresses.contains(s.getPrimaryIpAddress()))
    .collect(Collectors.toList());

