diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/Objects.java b/smack-core/src/main/java/org/jivesoftware/smack/util/Objects.java index a48696c60..26d0bbe85 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/Objects.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/Objects.java @@ -1,6 +1,6 @@ /** * - * Copyright 2015 Florian Schmaus + * Copyright 2015-2018 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,4 +28,8 @@ public class Objects { public static T requireNonNull(T obj) { return requireNonNull(obj, null); } + + public static boolean equals(Object a, Object b) { + return a == b || (a != null && a.equals(b)); + } }