SimpleExecutionState extends ExecutionState { public Map<String, String> getLabels() { return Collections.unmodifiableMap(labelsMetadata); } SimpleExecutionState(
      String stateName, String urn, HashMap<String, String> labelsMetadata); void reset(); String getUrn(); Map<String, String> getLabels(); @Override void takeSample(long millisSinceLastSample); long getTotalMillis(); @VisibleForTesting String getLullMessage(Thread trackedThread, Duration millis); @Override void reportLull(Thread trackedThread, long millis);  }
@Test public void testLabelsAndNameAreExtracted() { String stateName = "myState"; HashMap<String, String> labelsMetadata = new HashMap<String, String>(); labelsMetadata.put("k1", "v1"); labelsMetadata.put("k2", "v2"); SimpleExecutionState testObject = new SimpleExecutionState(stateName, null, labelsMetadata); assertEquals(testObject.getStateName(), stateName); assertEquals(2, testObject.getLabels().size()); assertThat(testObject.getLabels(), hasEntry("k1", "v1")); assertThat(testObject.getLabels(), hasEntry("k2", "v2")); }