RenderBucketType { public static RenderBucketType getRenderBucketType(final String name) { if (name == null) { throw new IllegalArgumentException("name must not be null!"); } RenderBucketType bucketType = bucketTypeMap.get(name); if (bucketType == null) { bucketType = new RenderBucketType(name); bucketTypeMap.put(name, bucketType); } return bucketType; } private  RenderBucketType(final String name); static RenderBucketType getRenderBucketType(final String name); String name(); @Override String toString(); static final RenderBucketType Inherit; static final RenderBucketType PreBucket; static final RenderBucketType Shadow; static final RenderBucketType Opaque; static final RenderBucketType Transparent; static final RenderBucketType OrthoOrder; static final RenderBucketType PostBucket; static final RenderBucketType Skip; }
@Test public void getPrebucket() throws Exception { final RenderBucketType preBucket = RenderBucketType.getRenderBucketType("PreBucket"); assertNotNull(preBucket); final RenderBucketType preBucket2 = RenderBucketType.getRenderBucketType("PreBucket"); assertSame(preBucket, preBucket2); assertSame(RenderBucketType.PreBucket, preBucket); }
@Test public void getUserDefined() throws Exception { final RenderBucketType myBucket = RenderBucketType.getRenderBucketType("MyBucket"); assertNotNull(myBucket); final RenderBucketType myBucket2 = RenderBucketType.getRenderBucketType("MyBucket"); assertSame(myBucket, myBucket2); }
@Test public void getWithNull() throws Exception { try { RenderBucketType.getRenderBucketType(null); fail(); } catch (final IllegalArgumentException e) {} }