private boolean isValidGateway(String gateway){
  return (gatewayList != null) && ((gatewayList.isEmpty()) || (gatewayList.contains(gateway)));
}

private boolean isValidGateway ( String gateway ) { return ( gatewayList != null ) && ( ( gatewayList . isEmpty ( ) ) || ( gatewayList . contains ( gateway ) ) ) ; }
check if gateway is trusted . true if list is empty or does not contain " none " or matches the one of the gateways in the list .
