--- old/src/java.base/share/classes/java/util/OptionalLong.java 2018-04-17 22:26:27.626575778 -0700 +++ new/src/java.base/share/classes/java/util/OptionalLong.java 2018-04-17 22:26:27.356550916 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,6 +140,17 @@ } /** + * If a value is not present, returns {@code true}, otherwise + * {@code false}. + * + * @return {@code true} if a value is not present, otherwise {@code false} + * @since 11 + */ + public boolean isEmpty() { + return !isPresent; + } + + /** * If a value is present, performs the given action with the value, * otherwise does nothing. *