Your peek() method should like this
public E peek() throws EmptyStructureException {
if (isEmpty()) {
throw new EmptyStructureException();
}
return (E)data[size - 1];
}
Your push() method should like this
public void push(E target) {
if (isFull()) {
stretch();
}
data[size] = target;
size++;
}
Your pop() method should like this
public E pop() throws EmptyStructureException {
if (isEmpty()) {
throw new EmptyStructureException();
}
size--;
return (E)data[size];
}
Now your interface look like below
public interface Stack<E> {
public boolean isEmpty();
public E peek() throws EmptyStructureException;
public E pop() throws EmptyStructureException;
public void push(E target);
}