TargetManager { public Targetable[] getTargets() { Targetable[] targets; if (targetList == null) { targets = new Targetable[0]; } else { targets = new Targetable[targetList.size()]; targets = (Targetable[])targetList.toArray(new Targetable[targetList.size()]); } return targets; } TargetManager(); static TargetManager getInstance(); void addTarget(Targetable target, boolean prepend); void addTarget(Targetable target); void removeTarget(Targetable target); Targetable[] getTargets(); void setTarget(Targetable newTarget); Targetable getTarget(); void addPropertyChangeListener(PropertyChangeListener listener); void removePropertyChangeListener(PropertyChangeListener listener); boolean doCommand(Object command, Object value);  }
@Test public void testGetTargets() { TargetManager manager = TargetManager.getInstance(); assertNull(manager.getTarget()); Targetable[] targets = manager.getTargets(); assertNotNull(targets); assertTrue(targets.length == 0); }