PcpMmvWriter implements PcpWriter { public void setClusterIdentifier(int clusterIdentifier) { Preconditions.checkArgument((clusterIdentifier & 0xFFFFF000)==0, "ClusterIdentifier can only be a 12bit value"); this.clusterIdentifier = clusterIdentifier; } @Deprecated  PcpMmvWriter(File file);  PcpMmvWriter(File file, IdentifierSourceSet identifierSources);  PcpMmvWriter(File file, IdentifierSourceSet identifierSources, MmvVersion mmvVersion);  PcpMmvWriter(ByteBufferFactory byteBufferFactory, IdentifierSourceSet identifierSources);  PcpMmvWriter(ByteBufferFactory byteBufferFactory, IdentifierSourceSet identifierSources, MmvVersion mmvVersion);  PcpMmvWriter(String name, IdentifierSourceSet identifierSources);  PcpMmvWriter(String name, IdentifierSourceSet identifierSources, MmvVersion mmvVersion); final void addMetric(MetricName name, Semantics semantics, Unit<?> unit, Object initialValue); final void addMetric(MetricName name, Semantics semantics, Unit<?> unit, T initialValue, TypeHandler<T> pcpType); final void registerType(Class<T> runtimeClass, TypeHandler<T> handler); final void updateMetric(MetricName name, Object value); final void start(); @Override void reset(); @Override final void setInstanceDomainHelpText(String instanceDomain, String shortHelpText, String longHelpText); @Override final void setMetricHelpText(String metricName, String shortHelpText, String longHelpText); void setClusterIdentifier(int clusterIdentifier); void setProcessIdentifier(int pid); void setPerMetricLock(boolean usePerMetricLock); void setFlags(Set<MmvFlag> flags); static void main(String[] args); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void ensureThatClusterIdentifierIsRestrictedTo12BitsOnly() throws Exception { pcpMmvWriter.setClusterIdentifier(1<<13); }
@Test public void ensureValid12BitIdentifierIsAllowed(){ pcpMmvWriter.setClusterIdentifier(1); }
@Test public void ensureBoundaryCaseOf12thBitIsOk(){ pcpMmvWriter.setClusterIdentifier(1<<11); }
@Test(expected = IllegalArgumentException.class) public void ensureNegativeClustersAreTreatedWithAppropriateContempt() { pcpMmvWriter.setClusterIdentifier(-1); }