### Question:
EC2Plugin implements Plugin { @Override public boolean isEnabled() { return metadata.containsKey(EC2MetadataFetcher.EC2Metadata.INSTANCE_ID); } EC2Plugin();  EC2Plugin(FileSystem fs, EC2MetadataFetcher metadataFetcher); @Override boolean isEnabled(); @Override String getServiceName(); void populateRuntimeContext(); @Override Map<String, @Nullable Object> getRuntimeContext(); void populateLogReferences(); @Override Set<AWSLogReference> getLogReferences(); @Override String getOrigin(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); static final String ORIGIN; }### Answer:
@Test public void testMetadataNotPresent() { when(metadataFetcher.fetch()).thenReturn(Collections.emptyMap()); ec2Plugin = new EC2Plugin(fakeFs, metadataFetcher); assertThat(ec2Plugin.isEnabled()).isFalse(); }