Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package apns;
 
 import java.util.Map;
 
 public class MockPushNotificationService implements PushNotificationService {
 
     private Map<StringPushNotificationmSentPushPerDeviceToken = new HashMap<>();
 
    @Override
    public void send(PushNotification pushNotificationApnsConnection connection) {
        for (String deviceToken : pushNotification.getDeviceTokens()) {
            .put(deviceToken.toLowerCase(), pushNotification);
        }
    }
    public boolean pushWasSentTo(String deviceToken) {
        return .containsKey(deviceToken.toLowerCase());
    }
    public PushNotification getLastPushSentToDevice(String deviceToken) {
        return .get(deviceToken);
    }
New to GrepCode? Check out our FAQ X