Buggy code:
@ SuppressWarnings ( "unused" ) public abstract class HazelcastTestSupport { public static final int ASSERT_TRUE_EVENTUALLY_TIMEOUT ; private TestHazelcastInstanceFactory factory ; public static Future spawn ( Runnable task ) { } public static < E > Future < E > spawn ( Callable < E > task ) { } public static Address getAddress ( HazelcastInstance hz ) { } public static SerializationService getSerializationService ( HazelcastInstance hz ) { } public static InternalOperationService getOperationService ( HazelcastInstance hz ) { } public static InternalPartitionService getPartitionService ( HazelcastInstance hz ) { } @ After public final void shutdownNodeFactory ( ) { } public static void setLoggingNone ( ) { } public static void setLoggingLog4j ( ) { } public static void setLogLevelDebug ( ) { } public static void setLogLevelInfo ( ) { } public static void setLogLevelWarn ( ) { } public static void setLogLevelError ( ) { } public static void setLogLevelFatal ( ) { } private static boolean isLog4jLoaded ( ) { } public static void sleepMillis ( int millis ) { } public static void sleepSeconds ( int seconds ) { } public static String generateRandomString ( int length ) { } public static String randomString ( ) { } public static String randomMapName ( ) { } public static String randomMapName ( String namePrefix ) { } public static String randomName ( ) { } public static String randomNameOwnedBy ( HazelcastInstance hz ) { } public static String randomNameOwnedBy ( HazelcastInstance instance , String prefix ) { Cluster cluster = instance . getCluster ( ) ; Member localMember = cluster . getLocalMember ( ) ; PartitionService partitionService = instance . getPartitionService ( ) ; for ( ; ; ) { String id = prefix + ( HazelcastTestSupport . randomString ( ) ) ; Partition partition = partitionService . getPartition ( id ) ; <START_BUG> if ( HazelcastTestSupport . comparePartitionOwnership ( true , localMember , partition ) ) { <END_BUG> return id ; } } } public static Partition randomPartitionOwnedBy ( HazelcastInstance hz ) { } public static void printAllStackTraces ( ) { } public static void interruptCurrentThread ( final int delayMillis ) { } public HazelcastInstance createHazelcastInstance ( ) { } public HazelcastInstance createHazelcastInstance ( Config config ) { } protected final TestHazelcastInstanceFactory createHazelcastInstanceFactory ( int nodeCount ) { } protected final TestHazelcastInstanceFactory createHazelcastInstanceFactory ( String ... addresses ) { } public static Node getNode ( HazelcastInstance hz ) { } public static void warmUpPartitions ( HazelcastInstance ... instances ) { } public static int getPartitionId ( HazelcastInstance hz ) { } public static String generateKeyOwnedBy ( HazelcastInstance instance ) { } public static String generateKeyNotOwnedBy ( HazelcastInstance instance ) { } protected static String generateKeyOwnedBy ( HazelcastInstance instance , boolean generateOwnedKey ) { } private static void checkMemberCount ( boolean generateOwnedKey , Cluster cluster ) { } private static boolean comparePartitionOwnership ( boolean generateOwnedKey , Member member , Partition partition ) { } public static boolean isInstanceInSafeState ( final HazelcastInstance instance ) { } public static void waitInstanceForSafeState ( final HazelcastInstance instance ) { } public static boolean isClusterInSafeState ( final HazelcastInstance instance ) { } public static void waitClusterForSafeState ( final HazelcastInstance instance ) { } public static boolean isAllInSafeState ( ) { } public static boolean isAllInSafeState ( Collection < HazelcastInstance > nodes ) { } public static void waitAllForSafeState ( ) { } public static void waitAllForSafeState ( final Collection < HazelcastInstance > nodes ) { } public static void waitAllForSafeState ( final HazelcastInstance ... nodes ) { } public static void assertStartsWith ( String expected , String actual ) { } private static String formatAssertMessage ( String message , Object expected , Object actual ) { } private static void formatClassAndValue ( StringBuilder message , Object value , String valueString ) { } public static void assertJoinable ( Thread ... threads ) { } public static void assertIterableEquals ( Iterable iterable , Object ... values ) { } public static void assertSizeEventually ( int expectedSize , Collection c ) { } public static void assertSizeEventually ( final int expectedSize , final Collection c , long timeoutSeconds ) { } public static void assertSizeEventually ( int expectedSize , Map < ? , ? > m ) { } public static void assertSizeEventually ( final int expectedSize , final Map < ? , ? > m , long timeoutSeconds ) { } public static < E > void assertEqualsEventually ( final FutureTask < E > task , final E value ) { } public static < E > void assertEqualsEventually ( final Callable < E > task , final E value ) { } public static void assertClusterSize ( int expectedSize , HazelcastInstance instance ) { } public static void assertClusterSizeEventually ( int expectedSize , HazelcastInstance instance ) { } public static void assertClusterSizeEventually ( final int expectedSize , final HazelcastInstance instance , long timeoutSeconds ) { } public static void assertJoinable ( long timeoutSeconds , Thread ... threads ) { } public static void assertOpenEventually ( CountDownLatch latch ) { } public static void assertOpenEventually ( String message , CountDownLatch latch ) { } public static void assertOpenEventually ( CountDownLatch latch , long timeoutSeconds ) { } public static void assertOpenEventually ( String message , CountDownLatch latch , long timeoutSeconds ) { } public static void assertTrueAllTheTime ( AssertTask task , long durationSeconds ) { } public static void assertTrueEventually ( AssertTask task , long timeoutSeconds ) { } public static void assertTrueEventually ( AssertTask task ) { } public static void assertTrueDelayed5sec ( AssertTask task ) { } public static void assertTrueDelayed ( int delaySeconds , AssertTask task ) { } public static void assertEqualsStringFormat ( String message , Object expected , Object actual ) { } public final class DummyUncheckedHazelcastTestException extends RuntimeException { } public static void assertExactlyOneSuccessfulRun ( AssertTask task ) { } public static void assertExactlyOneSuccessfulRun ( AssertTask task , int giveUpTime , TimeUnit timeUnit ) { } }

Fix:
if ( HazelcastTestSupport . comparePartitionOwnership ( false , localMember , partition ) ) {