@Test public void isMe () { doReturn(RESPONSE).when(awsEC2SelfAwareness).fetchInstanceId(); assertTrue(awsEC2SelfAwareness.isMe(RESPONSE)); assertTrue(awsEC2SelfAwareness.isMe(RESPONSE)); assertFalse(awsEC2SelfAwareness.isMe(RESPONSE.substring(RESPONSE.length() - 1))); verify(awsEC2SelfAwareness, times(1)).fetchInstanceId(); }
public boolean isMe (@NotNull String otherInstanceId) { if (!initialized) init(); return (otherInstanceId.equals(instanceId)); }
AwsEC2SelfAwareness { public boolean isMe (@NotNull String otherInstanceId) { if (!initialized) init(); return (otherInstanceId.equals(instanceId)); } }
AwsEC2SelfAwareness { public boolean isMe (@NotNull String otherInstanceId) { if (!initialized) init(); return (otherInstanceId.equals(instanceId)); }  }
AwsEC2SelfAwareness { public boolean isMe (@NotNull String otherInstanceId) { if (!initialized) init(); return (otherInstanceId.equals(instanceId)); }  boolean isMe(@NotNull String otherInstanceId); }
AwsEC2SelfAwareness { public boolean isMe (@NotNull String otherInstanceId) { if (!initialized) init(); return (otherInstanceId.equals(instanceId)); }  boolean isMe(@NotNull String otherInstanceId);  }