ProfileCallStack { public int push(final ProfileData profileData) { if (isOverflow()) { overflowIndex++; return index + overflowIndex; } checkExtend(index + 1); stack[index++] = profileData; profileData.setSequence(sequence++); profileData.setLevel(index); return index; } ProfileCallStack(ProfileData rootProfile);  ProfileCallStack(ProfileData rootProfile, int maxStackSize); ProfileData getRoot(); int push(final ProfileData profileData); ProfileData pop(); boolean isEmpty();  }
@Test public void testPush() { ProfileCallStack profileCallStack = new ProfileCallStack(root); assertThat(profileCallStack.push(root), is(1)); assertThat(profileCallStack.push(new ProfileMethod()), is(2)); }