BuddySupport { public static Component createGap(int width) { return Box.createHorizontalStrut(width); }  static void addLeft(Component c, JTextField textField); static void addRight(Component c, JTextField textField); static void add(Component c, Position pos, JTextField textField); static void addGap(int width, Position pos, JTextField textField); static void setRight(JTextField textField, List<Component> rightBuddies); static void setLeft(JTextField textField, List<Component> leftBuddies); static void set(List<Component> buddies, Position pos, JTextField textField); static List<Component> getLeft(JTextField textField); static List<Component> getRight(JTextField textField); static List<Component> getBuddies(Position pos, JTextField textField); static boolean isBuddy(Component c, JTextField textField); static void remove(JComponent c, JTextField textField); static void removeAll(JTextField textField); static void setOuterMargin(JTextField buddyField, Insets margin); static Insets getOuterMargin(JTextField buddyField); static void ensureBuddiesAreInComponentHierarchy(JTextField textField); static Component createGap(int width); static final String OUTER_MARGIN; }
@Test public void testCreateNegativeGap() throws Exception { Component c = BuddySupport.createGap(-1); Assert.assertSame(-1, c.getPreferredSize().width); }