DataflowSideInputReadCounter implements SideInputReadCounter { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("sideInputIndex", sideInputIndex) .add("declaringStep", declaringOperationContext.nameContext()) .toString(); } DataflowSideInputReadCounter(
      DataflowExecutionContext executionContext,
      DataflowOperationContext operationContext,
      int sideInputIndex); @Override void addBytesRead(long n); @Override Closeable enter(); @Override String toString();  }
@Test public void testToStringReturnsWellFormedDescriptionString() { DataflowExecutionContext mockedExecutionContext = mock(DataflowExecutionContext.class); DataflowOperationContext mockedOperationContext = mock(DataflowOperationContext.class); final int siIndexId = 3; ExecutionStateTracker mockedExecutionStateTracker = mock(ExecutionStateTracker.class); when(mockedExecutionContext.getExecutionStateTracker()).thenReturn(mockedExecutionStateTracker); Thread mockedThreadObject = mock(Thread.class); when(mockedExecutionStateTracker.getTrackedThread()).thenReturn(mockedThreadObject); DataflowSideInputReadCounter testObject = new DataflowSideInputReadCounter(mockedExecutionContext, mockedOperationContext, siIndexId); assertThat( testObject.toString(), equalTo("DataflowSideInputReadCounter{sideInputIndex=3, declaringStep=null}")); }